SA-MP Forums Archive
Command Issue - 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)
+--- Thread: Command Issue (/showthread.php?tid=378709)



Command Issue - AaronKillz - 19.09.2012

The command works, I get the message saying I've joined the event. But, it says "Server: Unknown command." after.
Help?

Код:
CMD:joinevent( playerid, params[] )
{
	if( eventstarted == 1 )
	{
		if(joinedevent == 1) return SendClientMessage(playerid, COLOR_WHITE, "You're already in the event.");
		if(Events == 0) return SendClientMessage(playerid, COLOR_WHITE, "Theres No events Running at the moment.");
		if(eventlocked == 1) return SendClientMessage(playerid, COLOR_WHITE, "The Event is not Accepting New Players");
		
		joinedevent = 1;
		SetPlayerPos( playerid, eventpos[0], eventpos[1], eventpos[2] );
		ResetPlayerWeapons(playerid);
		GivePlayerWeapon( playerid, eventweapon );
		SendClientMessage(playerid, -1, "{FFFFFF}You {2BEA15}joined {FFFFFF}the event.");
	}
	return true;
}



Re: Command Issue - Backwardsman97 - 19.09.2012

Try returning 1 inside at the end of the if statement.


Re: Command Issue - XtremeR - 19.09.2012

try this

pawn Код:
CMD:joinevent( playerid, params[] )
{
    if( eventstarted == 1 )
    {
        if(joinedevent == 1) return SendClientMessage(playerid, COLOR_WHITE, "You're already in the event.");
        if(Events == 0) return SendClientMessage(playerid, COLOR_WHITE, "Theres No events Running at the moment.");
        if(eventlocked == 1) return SendClientMessage(playerid, COLOR_WHITE, "The Event is not Accepting New Players");
       
        joinedevent = 1;
        SetPlayerPos( playerid, eventpos[0], eventpos[1], eventpos[2] );
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon( playerid, eventweapon );
        SendClientMessage(playerid, -1, "{FFFFFF}You {2BEA15}joined {FFFFFF}the event.");
    }
    return 1;
}