[Help] How to transform ZCMD into strcmp
#1

Ok this is the problem... i've tried anything but i can't figure out how to change some commands from zcmd into strcmp... my whole gamemode is in strcmp and it would be a waste of time to change everything into zcmd... For example i want to change this command but not stop using its sscanf becouse i don't know how to write this command in strcmp:

pawn Код:
CMD:xgoto(playerid,params[])
    {
        if(PlayerInfo[playerid][pAdmin] >= 1338 && IsPlayerAdmin(playerid))
        {
            new Float:x, Float:y, Float:z;
            if (sscanf(params, "fff", x, y, z)) SendClientMessage(playerid, 0xFF0000AA, "Use: \"/xgoto <X Float> <Y Float> <Z Float>\"");
            else
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
                }
                else
                {
                    SetPlayerPos(playerid, x, y, z);
                }
                format(string, sizeof(string), "You've set your coord to %f, %f, %f", x, y, z);
                SendClientMessage(playerid, 0xBBBBBBAA, string);
            }
        }
        return 1;
    }
can anyone give me a pattern or something how to change it or a convertor or i don't know ?
Reply
#2

actualy i've tried to start using sscanf + zcmd but i don't know what happens but my sscanf doesn't work, what ever ID i type in it says Unknown ID, even though i updated my sscanf it keeps happening... i've even borowed pawno from my friend, and when he compiles the gamemode it's working, when i do it, nothing... and thats when i decided that even though strcmp is 100000000 times slower then zcmd i would keep on going with strcmp becouse there is no use of sscanf which is buging on my computer or something like that :S
Reply
#3

Quote:

- - - and when he compiles the gamemode it's working, when i do it, nothing. - - -

Check your include files in ../pawno/include folder.

Seems like they are out dated.
Reply
#4

I have even written a tutorial on how to convert commands to use ZCMD.

And you might have to waste some time on re-writing the commands, but there's much positive about it. The command handling becomes faster (specially if you have more than just a few of them) and I don't know if it is specific to me, but I feel sort of satisfaction every time I have switched to use a new technique that speeds up my gamemode. So you should definitely go for re-writing strcmp commands into ZCMD instead of re-writing ZCMD commands into strcmp!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)