Event 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)
+--- Thread: Event Command. (
/showthread.php?tid=579951)
Event Command. -
BlueEyes - 01.07.2015
Hi Guyz,
I need some help,i have made startevent command but when i type it in game the text i have written in pwn doesn't displays on screen please help me,this is my code
PHP код:
CMD:startevent(playerid,params[])
{
new ename; new eprize; new gun; new ammo; new string[128]; new estring[128]; new joinable=0;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"Unknown command type /cmds for the full list of commands!");
if(joinable==1) return SendClientMessage(playerid,COLOR_ERROR,"There Is Already An Event Going On.");
else if(sscanf(params,"s[128]iiii",ename,eprize,gun,ammo))
return SendClientMessage(playerid,COLOR_ERROR,"/startevent [Event Name] [Prize] [Weapon] [Ammo]");
else if(gun > 39 || gun < 0) return SendClientMessage(playerid,COLOR_ERROR,"This Weapon Can Get That Player Ban!");
else
{
format(string,128,"'%s' has been started as an event! Use /join to join the fun!",ename);
SendClientMessageToAll(COLOR_CYAN,string);
format(estring,128,"~n~~n~~b~'%s' ~w~has been started!~w~Use ~g~/join to join the fun!",ename);
GameTextForAll(estring,5000,5);
joinable=1;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}
Re: Event Command. -
Sithis - 01.07.2015
If you put
PHP код:
print("[Debug] CMD:startevent has been called.");
before the first line with
, does it print that to the console?
Re: Event Command. -
BlueEyes - 01.07.2015
I Can't Understand brah
Re: Event Command. -
Sithis - 01.07.2015
Use this:
PHP код:
CMD:startevent(playerid,params[])
{
print("[Debug] CMD:startevent has been called.");
new ename; new eprize; new gun; new ammo; new string[128]; new estring[128]; new joinable=0;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_ERROR,"Unknown command type /cmds for the full list of commands!");
if(joinable==1) return SendClientMessage(playerid,COLOR_ERROR,"There Is Already An Event Going On.");
else if(sscanf(params,"s[128]iiii",ename,eprize,gun,ammo))
return SendClientMessage(playerid,COLOR_ERROR,"/startevent [Event Name] [Prize] [Weapon] [Ammo]");
else if(gun > 39 || gun < 0) return SendClientMessage(playerid,COLOR_ERROR,"This Weapon Can Get That Player Ban!");
else
{
format(string,128,"'%s' has been started as an event! Use /join to join the fun!",ename);
SendClientMessageToAll(COLOR_CYAN,string);
format(estring,128,"~n~~n~~b~'%s' ~w~has been started!~w~Use ~g~/join to join the fun!",ename);
GameTextForAll(estring,5000,5);
joinable=1;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z);
}
return 1;
}
Re: Event Command. -
BlueEyes - 01.07.2015
Not Working,again and again:/startevent [Event Name] [Prize] [Weapon] [Ammo]
Re: Event Command. -
Sithis - 01.07.2015
Did the message print to your console? (Show your server log maybe?)
Re: Event Command. -
BlueEyes - 01.07.2015
No didn't worked
PHP код:
SA-MP Dedicated Server
----------------------
v0.3.7, (C)2005-2015 SA-MP Team
[12:28:51] plugins = "" (string)
[12:28:51]
[12:28:51] Server Plugins
[12:28:51] --------------
[12:28:51] Loaded 0 plugins.
[12:28:51]
[12:28:51] Filterscripts
[12:28:51] ---------------
[12:28:51] Loading filterscript 'DD.amx'...
[12:28:51] Loaded 1 filterscripts.
[12:28:51]
----------------------------------
[12:28:51] Total TDM Script
[12:28:51] ----------------------------------
[12:28:51] Number of vehicle models: 8
[12:29:15] [connection] 192.168.35.100:62817 requests connection cookie.
[12:29:16] Incoming connection: 192.168.35.100:62817 id: 0
[12:29:16] [join] ..Sup.. has joined the server (0:192.168.35.100)
[12:29:40] RCON (In-Game): Player #0 (..Sup..) failed login.
[12:29:44] RCON (In-Game): Player #0 (..Sup..) has logged in.
[12:29:48] [Debug] CMD:startevent has been called.
[12:30:01] [Debug] CMD:startevent has been called.
[12:31:01] [part] ..Sup.. has left the server (0:1)
Re: Event Command. -
Vince - 01.07.2015
Sscanf line is wrong, 5 specifiers vs 4 variables. Also "joinable" is completely useless because it is a local variable. It gets discarded when the function ends.