SA-MP Forums Archive
[HELP]Arena for 2 players!!!! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Arena for 2 players!!!! (/showthread.php?tid=153792)



[HELP]Arena for 2 players!!!! - J. - 10.06.2010

Can anyone help me make this arena only allows two players compete dm. If another player wants to get a message "The arena is full"!

Thanks

Код:
if (strcmp(cmdtext,"/x1", true)==0)
	{
	SetPlayerInterior(playerid,0);
	SetPlayerPos(playerid,1531.834,-1131.411,135.488);
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s was to x1 (/x1)", pname);
    SendClientMessageToAll(COLOR_RED, string);
    GivePlayerWeapon(playerid,4,0);
    GivePlayerWeapon(playerid,26,500);
    GivePlayerWeapon(playerid,31,500);
    GivePlayerWeapon(playerid,24,500);
    GivePlayerWeapon(playerid,32,500);
	return 1;
	}



Re: [HELP]Arena for 2 players!!!! - Niixie - 10.06.2010

Global: new Isx1Full;

Код:
if (strcmp(cmdtext,"/x1", true)==0)
{
    if(Isx1Full == 2)
    {
        SendClientMessage(playerid, COLOR_RED, "DM x1 is full!");
	}
	else
	{
		SetPlayerInterior(playerid,0);
		SetPlayerPos(playerid,1531.834,-1131.411,135.488);
    	new pname[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    	format(string, sizeof(string), "%s was to x1 (/x1)", pname);
    	SendClientMessageToAll(COLOR_RED, string);
    	GivePlayerWeapon(playerid,4,0);
    	GivePlayerWeapon(playerid,26,500);
    	GivePlayerWeapon(playerid,31,500);
    	GivePlayerWeapon(playerid,24,500);
    	GivePlayerWeapon(playerid,32,500);
        if(Isx1Full == 0) { Isx1Full = 1; } else { Isx1Full = 2; }
	}
	return 1;
}
Try that