INVALID_PLAYER_ID not returning in Dialog Reponse
#1

Код:
case DIALOG_RACING:
	{
		new userid = strlen(inputtext);
      		RaceInvite[userid] = playerid;
		RaceAccepter[playerid] = userid;
	        if(!userid) return SendClientMessage(playerid, GREY, "[ERROR]: {FFFFFF}Insert a player ID to proceed.");
		if(response)
		{
		        if(InRace[playerid] == 1) return SendClientMessage(playerid, GREY, "[ERROR]: {FFFFFF}You're already racing!");
		        if(InRace[userid] == 1) return SendClientMessage(playerid, GREY, "[ERROR]: {FFFFFF}This player is already racing!");
		        if(userid == INVALID_PLAYER_ID)
		        {
				SendClientMessage(playerid, CINZA, "[ERROR]: {FFFFFF}This player isnt connected!");
			}
		    	if(userid != INVALID_PLAYER_ID)
		    	{
				ShowPlayerDialog(playerid, DIALOG_RACE_MAP, DIALOG_STYLE_LIST, "Select the map", "Countryside\nMountainss\n{B22222}Underwater Race\n{B22222}Lost City\n{B22222}Countryside (Mirror)\n{B22222}Rainbow Road", "Confirm", "Cancel");
			}
		}
The problem is that when I type an invalid ID it still goes to the next dialog.

Also, with !IsPlayerConnected(userid) it returns the error message be it a valid or invalid player id.

Send help please!
Reply
#2

And how do I do that? Couldn't find any examples to get the ideia
Reply
#3

pawn Код:
if(!sscanf(inputtext, "u", userid))
{
    // code here
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)