SA-MP Forums Archive
help disable not working - 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: help disable not working (/showthread.php?tid=472966)



help disable not working - kbalor - 31.10.2013

Duel invite player
Код:
	
        if(dialogid == DUELDIAG+1)
	{
	    if(response)
	    {
	        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");
	        SetPVarInt(playerid, "dPID", invitee);
   		ShowDuelSettingsDialog(playerid);
	   }
           else ShowDuelSettingsDialog(playerid);
	}
I Added
Код:
if(pInVIP[invitee] == 1) return GameTextForPlayer(playerid,"~r~Command disabled at this moment",2000,3);
FINAL

So after a player went to a vip room and I tried to invite him in a duel it still allow him to invite to duel. It should be not. It should say "Command disabled at this moment"

Код:
	
        if(dialogid == DUELDIAG+1)
	{
	    if(response)
	    {
	        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");
	        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");
	        SetPVarInt(playerid, "dPID", invitee);
   		ShowDuelSettingsDialog(playerid);
	   }
           else ShowDuelSettingsDialog(playerid);
	}



Re: help disable not working - Jefff - 31.10.2013

replace if(pInVIP[invitee] == 1) to if(pInVIP[playerid] == 1) ?


Re: help disable not working - kbalor - 31.10.2013

Quote:
Originally Posted by Jefff
Посмотреть сообщение
replace if(pInVIP[invitee] == 1) to if(pInVIP[playerid] == 1) ?
Hmm. Does this target myself instead of the player I want to invite?

As you see if it should be like this when I target a player that is not online. You can see the similary of the code I posted below.


Код:
if(invitee == INVALID_PLAYER_ID) return ShowPlayerDialog(playerid, DUELDIAG+1, DIALOG_STYLE_INPUT, "Select a player", "The player specified is not connected, try again....
So I tried to make my own

Код:
if(pInVIP[invitee] == 1) return GameTextForPlayer(playerid,"~r~Command disabled at this moment",2000,3);



Re: help disable not working - kbalor - 01.11.2013

A little help anyone?


Re: help disable not working - Konstantinos - 01.11.2013

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);



Re: help disable not working - kbalor - 01.11.2013

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
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);
It dooesn't show any "Command disable at this moment"

Also this line is in duel filterscript
Код:
if(pInVIP[invitee] == 1) return GameTextForPlayer(playerid,"~r~Command disabled at this moment",2000,3);
but this
Код:
pInVIP[playerid] = 1;
is in a different filterscript.

Код:
CMD:vroom(playerid, params[])
{
	if(pInfo[playerid][Donator] >= 1)
    {
    	SetPlayerPos(playerid, -710.6376,1851.7188,8.7459);
		SetPlayerFacingAngle(playerid, 270);
		SetPlayerInterior(playerid, 0);
		SetPlayerVirtualWorld(playerid, 20);
		SetCameraBehindPlayer(playerid);
		DestroyVehicle(GetPlayerVehicleID(playerid));
		pInVIP[playerid] = 1;
  		SetPVarInt(playerid, "CMDDisabled", 1);
	}
	else return ShowPlayerDialog(playerid, DIALOG_NOVIP, DIALOG_STYLE_MSGBOX,"{09F7DF}NONE-VIP Member", "\n{ffd700}You must be at least VIP Level 1 (Bronze)", "Close", "");
}
Do you think thats the problem that is why its not showing?