SA-MP Forums Archive
Help with 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)
+--- Thread: Help with ZCMD (/showthread.php?tid=335211)



Help with ZCMD - newbienoob - 17.04.2012

I can't use spaces in ZCMD. Example:

With spaces ( v infernus )
pawn Код:
CMD:v infernus(playerid,params[])
{
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,A);
    new veh = CreateVehicle(411,X,Y,Z,A,-1,-1,-1);
    PutPlayerInVehicle(playerid,veh,0);
    return 1;
}
Pawno will stop working



Without spaces ( vinfernus )
pawn Код:
CMD:vinfernus(playerid,params[])
{
    new Float:X, Float:Y, Float:Z, Float:A;
    GetPlayerPos(playerid,X,Y,Z);
    GetPlayerFacingAngle(playerid,A);
    new veh = CreateVehicle(411,X,Y,Z,A,-1,-1,-1);
    PutPlayerInVehicle(playerid,veh,0);
    return 1;
}
Successfully compiled



Re: Help with ZCMD - aRoach - 17.04.2012

Use SSCANF or ( IDK if it's working, try it ) :
pawn Код:
CMD:v_infernus(playerid,params[])



Re: Help with ZCMD - newbienoob - 17.04.2012

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Use SSCANF or ( IDK if it's working, try it ) :
pawn Код:
CMD:v_infernus(playerid,params[])
I need to type /v_infernus then.
Or is this zcmd bug?


Re: Help with ZCMD - aRoach - 17.04.2012

Well, try it, _ is nothing, is a Delimiter, is NULL, ...


Re: Help with ZCMD - [MG]Dimi - 17.04.2012

pawn Код:
CMD:v(playerid,params[])
{
    if(!strcmp("infernus",params,true))
    {
            new Float:X, Float:Y, Float:Z, Float:A;
            GetPlayerPos(playerid,X,Y,Z);
            GetPlayerFacingAngle(playerid,A);
            new veh = CreateVehicle(411,X,Y,Z,A,-1,-1,-1);
            PutPlayerInVehicle(playerid,veh,0);
    }
        return 1;
}



Re: Help with ZCMD - Ubuntu - 17.04.2012

You can't put spaces between commands...

You can do it this way:

CMD:v(playerid,params[])
{
if(!strcmp(params, "infernus", true)) {
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,A);
new veh = CreateVehicle(411,X,Y,Z,A,-1,-1,-1);
PutPlayerInVehicle(playerid,veh,0);
}
return 1;
}


Re: Help with ZCMD - newbienoob - 17.04.2012

Ok thanks. I will try.