Help with /createvent - 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: Help with /createvent (
/showthread.php?tid=319430)
Help with /createvent -
JhnzRep - 19.02.2012
Hi, /createvent works perfectly except...The first weapon(Second works fine).
pawn Код:
new Float:eX, Float:eY, Float:eZ, eGun, eGun1, eSkin, Event; //Obviously got this on top
pawn Код:
cmd(createvent, playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, GREY, "You are not authorized to use this command");
if(Event == 1 || Event == 2) SCM(playerid, GREY, "Event already started");
if(sscanf(params, "uii", eGun,eGun1, eSkin)) return SendClientMessage(playerid, GREY, "CMD:/createvent [Gun1] [Gun2] [Skin]");
GetPlayerPos(playerid, eX, eY, eZ);
GivePlayerWeapon(playerid, 38, 99999);
SendClientMessageToAll(GREEN, "Warning:An event has been opened, to join write /joinevent.");
SendClientMessageToAll(GREEN, "After the event you will spawn where you were, with all your weapons");
Event = 1;
return 1;
}
pawn Код:
cmd(joinevent, playerid, params[])
{
if(InEvent[playerid] == 1) return SCM(playerid, GREY, "You are already in the event!");
if(Event == 0) return SCM(playerid, GREY, "There is no event going on!");
if(Event == 2) return SCM(playerid, GREY, "Event is locked!");
UpdateStats(playerid);
SetSpawnInfo(playerid, 0, eSkin, eX, eY, eZ, 269.15, eGun, 99999, eGun1, 99999, 0, 0);
SpawnPlayer(playerid);
InEvent[playerid] = 1;
return 1;
}
What I mean by the first weapon not working is, it always sets it to 1, making ti brass knuckles.
Re: Help with /createvent -
Madd Kat - 19.02.2012
Well its in your sscanf
pawn Код:
* * if(sscanf(params, "iii", eGun,eGun1, eSkin)) return SendClientMessage(playerid, GREY, "CMD:/createvent [Gun1] [Gun2] [Skin]");
U is for userid/name.
i is for number
Sorry about format on my ipod....
Re: Help with /createvent -
JhnzRep - 19.02.2012
Thank you very much! Repped.