/leave command not working
#1

hey, i have made a command. the command is /sw (shotgunwar) when you type the command you teleports to a room and you keep spawning in. but you can cheat in there you can use /infernus or other commands i want it to be like you only can type /leave while in there.

i made 2 of those rooms the other is /m4w

Код:
if(m4w[playerid] == 1)
	{
		SendClientMessage(playerid, COLOR_NORMALRED, "You can not use commands when in War! Type /leave to use commands.");
	}
	else
	if(sw[playerid] == 1)
	{
		SendClientMessage(playerid, COLOR_NORMALRED, "You can not use commands when in War! Type /leave to use commands.");
	}
	else
	if (strcmp("/leave", cmdtext, true, 10) == 0)
	{
	    SpawnPlayer(playerid);
	    ResetPlayerWeapons(playerid);
		SetPlayerInterior(playerid, 0);
		sw[playerid] = 0;
		m4w[playerid] = 0;
		return 1;
	}
Reply
#2

okay i have changed it so i only can write /leave while in in some of the 2 rooms

Код:
if (strcmp("/leave", cmdtext, true, 10) == 0)
	{
		if(m4w[playerid] == 1)
		{
		SpawnPlayer(playerid);
		ResetPlayerWeapons(playerid);
		SetPlayerInterior(playerid, 0);
		sw[playerid] = 0;
		m4w[playerid] = 0;
		return 1;
		}
		else
		if(sw[playerid] == 1)
		{
		SpawnPlayer(playerid);
		ResetPlayerWeapons(playerid);
		SetPlayerInterior(playerid, 0);
		sw[playerid] = 0;
		m4w[playerid] = 0;
		return 1;
		}
		else
		{
		SendClientMessage(playerid, COLOR_NORMALRED, "You can only use this command while in war");
		return 1;
		}
	}
but i also want it to be like when i am in one of the 2 rooms i can't write any other commands than /leave ?

please help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)