Help with ZCMD
#1

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
Reply
#2

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

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?
Reply
#4

Well, try it, _ is nothing, is a Delimiter, is NULL, ...
Reply
#5

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;
}
Reply
#6

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;
}
Reply
#7

Ok thanks. I will try.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)