rendered paste body//Beginning of the script
new statut[MAX_PLAYERS];
new Float:gPositions[MAX_PLAYERS][4];
new SprayTimer;
//OnPlayerCommandText
if(strcmp(cmdtext, "/repair", true) == 0) {
if(IsPlayerInAnyVehicle(playerid)){
new Float:X, Float:Y, Float:Z;
new currentplayer;
for (currentplayer = 0; currentplayer < MAX_PLAYERS; currentplayer++)
GetPlayerPos(currentplayer, X, Y, Z);
if(X <= 2071.6 && X >= 2042.1 && Y <= -1821.7 && Y >= -1839.1) {
SendClientMessage(playerid, COLOR_RED, "Quelqu'un est en train de réparer sa moto, patientez quelques secondes");
}
else{
statut[playerid] = 6;
GetPlayerPos(playerid, gPositions[playerid][0], gPositions[playerid][1], gPositions[playerid][2]);
GetPlayerFacingAngle(playerid, gPositions[playerid][3]);
GivePlayerMoney(playerid,100);
SetVehicleZAngle(GetPlayerVehicleID(playerid),270.0);
SetVehiclePos(GetPlayerVehicleID(playerid),2064.4536,-1831.7820,13.1179);
SprayTimer = SetTimer("EndSpray", 5000, 0);
}
}
return 1;
}
//Public Spray Timer
public EndSpray(playerid) {
KillTimer(SprayTimer);
if(statut[playerid] == 6){
SetVehiclePos(GetPlayerVehicleID(playerid),gPositions[playerid][0], gPositions[playerid][1], gPositions[playerid][2]);
SetVehicleZAngle(GetPlayerVehicleID(playerid),gPositions[playerid][3]);
}
}