INVALID_PLAYER_ID not returning in Dialog Reponse - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: INVALID_PLAYER_ID not returning in Dialog Reponse (
/showthread.php?tid=664261)
INVALID_PLAYER_ID not returning in Dialog Reponse -
Dragonic - 23.02.2019
Код:
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!
Re: INVALID_PLAYER_ID not returning in Dialog Reponse -
Dragonic - 23.02.2019
And how do I do that? Couldn't find any examples to get the ideia
Re: INVALID_PLAYER_ID not returning in Dialog Reponse -
TheToretto - 23.02.2019
pawn Код:
if(!sscanf(inputtext, "u", userid))
{
// code here
}