SA-MP Forums Archive
/quitevent command? - 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: /quitevent command? (/showthread.php?tid=168738)



/quitevent command? - Mr. Despair - 17.08.2010

What's a /quitevent command because my current one doesn't work?

Код:
if(strcmp(cmdtext, "/quitevent", true) == 0)
	{
		if(IsAtEvent[playerid] != 0)
		{
			SetPlayerWeapons(playerid);
			IsAtEvent[playerid] = 0;
			ResetPlayerAdminWeaponsEx(playerid);
		}
		return 1;
	}
That's my current one and when you're in the event and you type it, nothing happens.


Re: /quitevent command? - RichyB - 17.08.2010

Whats the /joinevent command?


Re: /quitevent command? - Mr. Despair - 17.08.2010

Код:
if(strcmp(cmd, "/joinevent", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		    if(ActiveEvent == 1)
			{
			    if(EventLocked == 1)
			    {
			        SendClientMessage(playerid, COLOR_GREY, "   The event is currently locked !");
			        return 1;
			    }
			    if(IsAtEvent[playerid] == 1)
			    {
			        SendClientMessage(playerid, COLOR_GREY, "   You have already joined the event !");
			        return 1;
			    }
			    if(EventX == 0.0 && EventY == 0.0 && EventZ == 0.0)
			    {
			        SendClientMessage(playerid, COLOR_GREY, "   The event spawn has not been set !");
			        return 1;
			    }
			    SetPlayerPos(playerid, EventX, EventY, EventZ);
			    IsAtEvent[playerid] = 1;
			    SetPlayerVirtualWorld(playerid, EventWorld);
			    SetPlayerInterior(playerid, EventInt);
			    SetPlayerHealth(playerid, EventHP);
			    SetPlayerArmour(playerid, EventArmour);
			    ResetPlayerAdminWeaponsEx(playerid);
			    ResetPlayerWeapons(playerid);
			    GivePlayerAdminGun(playerid, EventWeapon1);
			    GivePlayerAdminGun(playerid, EventWeapon2);
			    GivePlayerAdminGun(playerid, EventWeapon3);
			    GivePlayerAdminGun(playerid, EventWeapon4);
			    GivePlayerAdminGun(playerid, EventWeapon5);
			    if(EventJoinText == 1)
			    {
			        GameTextForPlayer(playerid, EventText, 5000, 0);
			    }
			    SendClientMessage(playerid, COLOR_WHITE, "You have been teleported to the event.");
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "   There are currently no events active !");
			}
		}
		return 1;



Re: /quitevent command? - RichyB - 17.08.2010

Try this,

pawn Код:
if(strcmp(cmdtext, "/quitevent", true) == 0)
    {
        if(IsAtEvent[playerid] == 1)
        {
            IsAtEvent[playerid] = 0;
            SetPlayerPos(playerid, 1550.2311, -1675.4509, 15.3155); //Los Santos Police Department
            SendClientMessage(playerid, COLOR_WHITE, "You have quit the event.");
            SetPlayerWeapons(playerid);
            ResetPlayerAdminWeaponsEx(playerid);
            ResetPlayerWeapons(playerid);
        }
        return 1;
    }



Re: /quitevent command? - Mr. Despair - 17.08.2010

That worked except, I lost my weapon I had before I joined the event, and when I /quitevent I didn't have it.