[BUG/MISTAKE? WIth my /lock command
#1

Yo i've made a /lock command & /unlock but, I've tested it and it spams the message saying Vehicle doors have been unlocked to unlock them /unlock


I have no idea why it spams it i only want the message to show once, I'm a pawn Begginer btw so go easy thanks



XtremE


EDIT: Lol i forgot to show my code


Код:
if(!strcmp(cmdtext,"/lock",true))
	{  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF1400FF,"You must be in a vehicle to unlock the doors");
    for(new i=0; i < MAX_PLAYERS; i++)
    {
      if(i == playerid) continue;
      SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
      SendClientMessage(playerid,0xE1FF00FF,"Vehicle doors have been locked type /unlock to unlock them");
      PlayerPlaySound(playerid,1137, 0.0, 0.0, 0.0);
    }
		return 1;
	}
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/lock",true))
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xFF1400FF,"You must be in a vehicle to unlock the doors");
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(i == playerid) continue;
        SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
    }
    SendClientMessage(playerid,0xE1FF00FF,"Vehicle doors have been locked type /unlock to unlock them");
    PlayerPlaySound(playerid,1137, 0.0, 0.0, 0.0);
    return 1;
}
Reply
#3

Thanks what did i do wrong?
Reply
#4

The last but one bracket was moved
Reply
#5

You had SendClientMessage inside the looping code.
Reply
#6

Quote:
Originally Posted by Flashy
The last but one bracket was moved
Oh lol thanks
Reply
#7

Quote:
Originally Posted by Flashy
The last but one bracket was moved
Ok thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)