CMD:startevent(playerid,params[]) { new string[128]; new sstring[128]; if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Unknown command. Please use the correct commands."); if(joinable==1) return SendClientMessage(playerid,COLOR_RED,"There is already an event going on."); else if(sscanf(params,"s[128]iiiiii",ename,eprize,gun1,ammo1,gun2,ammo2)) return SendClientMessage(playerid,COLOR_PINK,"USAGE: /startevent [Event name (to be displayed)] [Prize] [Event weapon 1] [Ammo] [Event weapon 2] [Ammo]."); else if(gun1 > 39 || gun1 < 0) return SendClientMessage(playerid,COLOR_ORANGE,"What do you expect, a stick? Use weapon IDs within 0-40!"); else if(gun2 > 39 || gun2 < 0) return SendClientMessage(playerid,COLOR_ORANGE,"What do you expect, a stick? Use weapon IDs within 0-40!"); else { format(string,128,"'%s' has been started as an event! Use /join to join the fun!",ename); format(sstring,128,"~n~~n~~b~'%s' ~w~has been started!~w~Use ~g~/join to join the fun!",ename); SendClientMessageToAll(COLOR_LIGHTBLUE,string); GameTextForAll(sstring,5000,5); joinable=1; new Float:p1; new Float:p2; new Float:p3; GetPlayerPos(playerid,p1,p2,p3); SetPVarFloat(playerid,"locx",p1); SetPVarFloat(playerid,"locy",p2); SetPVarFloat(playerid,"locz",p3); } return 1; } CMD:join(playerid,params[]) { new s[128]; if(joinable==0) return SendClientMessage(playerid,COLOR_RED,"No events are going on, currently."); if(locked==1) { format(s,128,"The event '%s' has been locked by an admin. You cannot join it.",ename); SendClientMessage(playerid,COLOR_RED,s); return 1;} else { SetPlayerPos(playerid,GetPVarFloat(playerid, "locx"),GetPVarFloat(playerid, "locy"),GetPVarFloat(playerid, "locz")); SendClientMessage(playerid,COLOR_GREEN,"You have joined the event!"); GivePlayerWeapon(playerid,gun1,ammo1); GivePlayerWeapon(playerid,gun2,ammo2); joined[playerid]=1; } return 1; }
Please edit your main post with [code][./code] tag around your commands, its really unpleasant to read without them.
|
new Float:EventCoord[3];
GetPlayerPos(playerid,EventCoord[0],EventCoord[1],EventCoord[2]);
SetPlayerPos(playerid,EventCoord[0],EventCoord[1],EventCoord[2]);
GetPlayerFacingAngle (Float) GetPlayerInterior (Int) GetPlayerVirtualWorld (Int)
SetPlayerFacingAngle SetPlayerInterior SetPlayerVirtualWorld