1 command available
#9

Quote:
Originally Posted by Marricio
Посмотреть сообщение
It's possible, if you want 1 command avaible..

pawn Код:
public OnPlayerComandText(...)
{
    if(m4w[playerid] == 1 || sw[playerid] == 1) return SendClientMessage(playerid,color,"You're in m4w and sw and you cant use commands!");
}
well i did not get that to work i did like this:
Код:
if(m4w[playerid] == 1 || sw[playerid] == 1)
    {
	SendClientMessage(playerid,COLOR_NORMALRED,"You are in war and can not use any commands");
	return 1;
	}
	else
	if (strcmp("/leave", cmdtext, true, 10) == 0)
	{
		if(m4w[playerid] == 1)
		{
		SpawnPlayer(playerid);
		ResetPlayerWeapons(playerid);
		SetPlayerInterior(playerid, 1);
		sw[playerid] = 0;
		m4w[playerid] = 0;
		SetPlayerPos(playerid, 292.8136,-35.3702,1001.5156);
		return 1;
		}
		else
		if(sw[playerid] == 1)
		{
		SpawnPlayer(playerid);
		ResetPlayerWeapons(playerid);
		SetPlayerInterior(playerid, 1);
		sw[playerid] = 0;
		m4w[playerid] = 0;
		SetPlayerPos(playerid, 292.8136,-35.3702,1001.5156);
		return 1;
		}
		else
		{
		SendClientMessage(playerid, COLOR_NORMALRED, "You can only use this command while in war");
		return 1;
		}
	}
what i want this to do is:
1. you can only type the /leave command when sw = 1 or m4w = 1
2. you can't type other commands than /leave when sw = 1 or m4w = 1
Reply


Messages In This Thread
1 command available - by Madsen - 09.03.2011, 11:51
Re: 1 command available - by Roomeo - 09.03.2011, 12:02
Re: 1 command available - by Skylar Paul - 09.03.2011, 12:16
Re: 1 command available - by alpha500delta - 09.03.2011, 12:25
Re: 1 command available - by Madsen - 09.03.2011, 13:44
Re: 1 command available - by Madsen - 09.03.2011, 20:22
Re: 1 command available - by Marricio - 09.03.2011, 21:15
Re: 1 command available - by Madsen - 10.03.2011, 13:21
Re: 1 command available - by Madsen - 11.03.2011, 13:55

Forum Jump:


Users browsing this thread: 1 Guest(s)