[HELP]Arena for 2 players!!!!
#1

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;
	}
Reply
#2

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)