onconnection
#1

hey guys i have this command it works fine when you are alone on server ... but when someone or more people connect when you use it instead of saying after you use it and if you type again /fixit it should say "someone already repair this generator please find another one" but if i am on with a friend and i type if no one is near generator or near me it's says "someone already repair this generator etc..." but it let me repair it , why?

Код 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;
			}
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)