Problem with race
#1

Hey guys. I have this /startrace command and it goes like this
Код:
CMD:startrace(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
    if(AutomaticRace == true) return SendClientMessage(playerid, RED, "<!> Automatske trke su ukljucene!");
    if(BuildRace != 0) return SendClientMessage(playerid, RED, "<!> Neko gradi trku!");
    if(RaceBusy == 0x01 || RaceStarted == 1) return SendClientMessage(playerid, RED, "<!> Vec je jedna trka u toku!");
    if(isnull(params)) return SendClientMessage(playerid, RED, "<!> /startrace [ime trke]");
    LoadRace(playerid, params);
    return 1;
}
Now can you tell me why player that just registered can type /startrace and he can start it. Only admin should do this. I just don't know where is problem !!!!
Reply
#2

Fixed
Код:
CMD:startrace(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 3)
	{
		if(AutomaticRace == true)
		{
			SendClientMessage(playerid, RED, "<!> Automatske trke su ukljucene!");
			return 1;
		}
		if(BuildRace != 0)
		{
			SendClientMessage(playerid, RED, "<!> Neko gradi trku!");
			return 1;
		}
		if(RaceBusy == 0x01 || RaceStarted == 1)
		{
			SendClientMessage(playerid, RED, "<!> Vec je jedna trka u toku!");
			return 1;
		}
		if(isnull(params))
		{
			SendClientMessage(playerid, RED, "<!> /startrace [ime trke]");
			return 1;
		}
		LoadRace(playerid, params);
	}
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)