Command issues (ZCMD) - 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: Command issues (ZCMD) (
/showthread.php?tid=127036)
Command issues (ZCMD) -
biltong - 11.02.2010
Having issues making my /forthelulz command return /ftl. Here's the code:
pawn Код:
zcmd(forthelulz,playerid,params[])
{
return zcmd(ftl,playerid,params[]); //line 177
}
zcmd(ftl,playerid,params[])
{
if(HasPlayerLulzed[MAX_PLAYERS] == 0)
{
SetPlayerDrunkLevel(playerid,50000);
new Float:X, Float:Y, Float:Z;
GetPlayerVelocity(playerid,X,Y,Z);
SetPlayerVelocity(playerid,X*1.5,Y*1.5,(Z+1)*1.5);
SetTimer(public stoplulz,30000,false);
new name[MAX_PLAYER_NAME];
new string[64];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"*****%s is lulzing, watch out!",name);
SendClientMessageToAll(yellow,string);
HasPlayerLulzed[MAX_PLAYERS] += 1;
SetTimer(public SetHasPlayerLulzed,60000,false);
}
else SendClientMessage(playerid,red,"You can only lulz once every minute!");
return 1;
}
public stoplulz(playerid)
{
SetPlayerDrunkLevel(playerid, 0)
SendClientMessage(playerid,lightred,"You stopped lulzing.");
}
public SetHasPlayerLulzed(playerid)
{
HasPlayerLulzed[MAX_PLAYERS] == 1;
return 1;
}
But it tells me that line 177 is an invalid expression and assumed zero THREE TIMES (WTF?)
I tried making the zcmds COMMAND:ftl and such, but that told me ftl was never used, along with any of my timer functions.
I also know theres lots else wrong with that code, so if someone could help me fix it up, it would go greatly appreciated
Re: Command issues (ZCMD) -
Joe Staff - 11.02.2010
zcmd isn't the function you should be calling. You should be calling this:
pawn Код:
cmd_something(playerid, params[]);
Quoted from the release thread of ZCMD
http://forum.sa-mp.com/index.php?topic=116240.0
Re: Command issues (ZCMD) -
biltong - 11.02.2010
I know, but every time I return cmd_ftl(playerid,params[]); I get warnings that all of those functions are never used -.-