help disable not working
#5

pawn Код:
new invitee;
if(pInVIP[invitee] == 1) return GameTextForPlayer(playerid,"~r~Command disabled at this moment",2000,3);
if(sscanf(inputtext, "u", invitee)) return ShowPlayerDialog(playerid, DUELDIAG+1, DIALOG_STYLE_INPUT, "{09F7DF}Select a player", "{FFFFFF}Type in the name/playerid of the player you want\nto invite to a duel \n\n{ffd700}Note: You can enter partial names", "Continue", "Back");
You must use sscanf first because it'll check for: if(pInVIP[0] == 1)

NOTE: and BEFORE: if(invitee == INVALID_PLAYER_ID) to prevent index out of bounds runtime error.

pawn Код:
new invitee;
if(sscanf(inputtext, "u", invitee)) return ShowPlayerDialog(playerid, DUELDIAG+1, DIALOG_STYLE_INPUT, "{09F7DF}Select a player", "{FFFFFF}Type in the name/playerid of the player you want\nto invite to a duel \n\n{ffd700}Note: You can enter partial names", "Continue", "Back");
if(invitee == INVALID_PLAYER_ID) return ShowPlayerDialog(playerid, DUELDIAG+1, DIALOG_STYLE_INPUT, "{09F7DF}Select a player", "{FF0000}The player specified is not connected, try again\n\n{FFFFFF}Type in the name/playerid of the player you want\nto invite to a duel \n\n{ffd700}Note: You can enter partial names", "Continue", "Back");
if(pInVIP[invitee] == 1) return GameTextForPlayer(playerid,"~r~Command disabled at this moment",2000,3);
SetPVarInt(playerid, "dPID", invitee);
ShowDuelSettingsDialog(playerid);
Reply


Messages In This Thread
help disable not working - by kbalor - 31.10.2013, 19:45
Re: help disable not working - by Jefff - 31.10.2013, 20:47
Re: help disable not working - by kbalor - 31.10.2013, 20:55
Re: help disable not working - by kbalor - 01.11.2013, 10:43
Re: help disable not working - by Konstantinos - 01.11.2013, 11:12
Re: help disable not working - by kbalor - 01.11.2013, 11:42

Forum Jump:


Users browsing this thread: 2 Guest(s)