ZCMD error - 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: ZCMD error (
/showthread.php?tid=400245)
ZCMD error -
PDChaseOfficial - 17.12.2012
Hey,
I am trying to make my siren command automatically go off when player presses horn key (KEY_CROUCH in vehicle). to do this, I need to return my siren command. I use it this way:
Код:
if(GetVehicleModel(VID)==596&&GetVehicleModel(VID)==523&&GetVehicleModel(VID)==599)
{
if(oldkeys & KEY_CROUCH && newkeys & KEY_CROUCH)
{
return 0;
}
else if(newkeys & KEY_CROUCH)
{
return cmd_siren(playerid, params);
}
}
I get this: error 017: undefined symbol "params"
Re: ZCMD error -
park4bmx - 17.12.2012
pawn Код:
if(GetVehicleModel(VID)==596 || GetVehicleModel(VID)==523 || GetVehicleModel(VID)==599)//it needs to be "||"
{
if(oldkeys & KEY_CROUCH && newkeys & KEY_CROUCH)
{
return 0;
}
else if(newkeys & KEY_CROUCH)
{
return cmd_siren(playerid, params[0]);//the params holds an Array!
}
}
it needs to be "||" you cant be in multiple vehicles once.
edit
if this cmd doesn't have any parameters then why have the params ?
pawn Код:
COMMAND:siren(playerid)
{
//cmds stuff
}
//Then use it likes this with the reurn
return cmd_siren(playerid);
Re: ZCMD error -
Konstantinos - 17.12.2012
pawn Код:
return cmd_siren(playerid, "");
There's no "params" as a parameter of the OnPlayerKeyStateChange callback.