27.10.2016, 05:36
hey guys i have a command that fix a generator .. but is a small problem if i am alone on the server it's working well but if someone or more join the server i get a message that shouldn't be there in that moment.
the command is:
and this message says:
but the thing is no one is near me or the generator and i get that message why ?
that message should give it to someone who try to repair the same generator with another player in the same time
the command is:
Код HTML:
CMD:fixit(playerid) { if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!"); if(Killer[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Nu poti folosi comanda, nu poti lasa supravietuitori sa scape!"); if(Pyromaniac[playerid] == 1) return SendClientMessage(playerid, COLOR_ERROR, "Nu poti folosi comanda, nu poti lasa supravietuitori sa scape!"); foreach(new i : Player) { if(Survivor[playerid] == 1) { if(IsPlayerInRangeOfPoint(playerid, 2.0, -1182.1416, -1008.2070, 129.2188)) { if(GeneratorOcupat[0] == 1) return SendClientMessage(playerid, COLOR_SYN, "(!) {FFFFFF}Cineva repara acest generator!"); if(Generator[0] == 1) return SendClientMessage(playerid, COLOR_SYN, "(!) {FFFFFF}Acest generator a fost deja reparat!"); ApplyAnimation(playerid,"BOMBER", "BOM_Plant",4.0,1,0,0,1,10000,1); generatorreparat[0] = SetTimerEx("generatorreparat0",10200, false, "i", playerid); SetTimerEx("generatorbug",100, false, "i", playerid); GeneratorOcupat[0] = 1; } } } }
Код HTML:
if(GeneratorOcupat[0] == 1) return SendClientMessage(playerid, COLOR_SYN, "(!) {FFFFFF}Cineva repara acest generator!"); Translate: Someone already repairing this generator
that message should give it to someone who try to repair the same generator with another player in the same time