SA-MP Forums Archive
convert zcmd to strcmp please - 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: convert zcmd to strcmp please (/showthread.php?tid=536706)



convert zcmd to strcmp please - georgian1 - 11.09.2014

hi guys can anybody convert zcmd to strcmp please ?

Thanks.


Код:
CMD:mlift(playerid, params[])
{
    if (isnull(params)) return SendClientMessage(playerid, -1, Usage: /mlift <up/down>");
    if (!strcmp(params, "up", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1569.34424, -2156.86060, 12.96720)) return SendClientMessage(playerid, blue, "You Are Not In Garage!");
        MoveObject(MechLift, 1569.34424, -2156.86060, 14.70720, 0.5);
    }
    else if (!strcmp(params, "down", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1569.34424, -2156.86060, 12.96720)) return SendClientMessage(playerid, blue, "You Are Not In Garage!");
        MoveObject(MechLift, 1569.34424, -2156.86060, 12.96720, 0.5);
    }
    else SendClientMessage(playerid, -1, "usage: up da down!");
    return 1;
}



Re: convert zcmd to strcmp please - Stinged - 11.09.2014

Why would you want to convert that to strcmp?
zcmd is much faster.


Re: convert zcmd to strcmp please - georgian1 - 11.09.2014

coz my server gm using strcmp so.. please convert it if you can

it ll not work together.


Re: convert zcmd to strcmp please - Pottus - 11.09.2014

This is like stepping on the brakes and throwing your car in reverse on the highway completely senseless.


Re: convert zcmd to strcmp please - georgian1 - 11.09.2014

can anybody do that ?!


Re: convert zcmd to strcmp please - SilverPortal - 11.09.2014

You could change all commands to ZCMD , it is much faster -
https://sampforum.blast.hk/showthread.php?tid=271043


Re: convert zcmd to strcmp please - Abagail - 11.09.2014

I'd recommend converting your gamemode to ZCMD. ZCMD is much more faster then STRCMP, how-ever here it is,

pawn Код:
if(strcmp(cmd, "/mlift", true) == 0)
{
   if (isnull(params)) return SendClientMessage(playerid, -1, Usage: /mlift <up/down>");
    if (!strcmp(params, "
up", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1569.34424, -2156.86060, 12.96720)) return SendClientMessage(playerid, blue, "
You Are Not In Garage!");
        MoveObject(MechLift, 1569.34424, -2156.86060, 14.70720, 0.5);
    }
    else if (!strcmp(params, "
down", true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1569.34424, -2156.86060, 12.96720)) return SendClientMessage(playerid, blue, "
You Are Not In Garage!");
        MoveObject(MechLift, 1569.34424, -2156.86060, 12.96720, 0.5);
    }
    else SendClientMessage(playerid, -1, "
usage: up da down!");
    return 1;
}
NOTE: You'll need to include the "isnull" function if you don't have it already as it's included with ZCMD.


Re: convert zcmd to strcmp please - georgian1 - 11.09.2014

ty but now i have this

error 017: undefined symbol "params"

i must define "params" ?


Re: convert zcmd to strcmp please - Dignity - 11.09.2014

Params are automatically defined when using a ZCMD command. Use strtok:

https://sampwiki.blast.hk/wiki/Strtok

Although I recommend using sscanf2 instead:

https://sampforum.blast.hk/showthread.php?tid=120356


Re: convert zcmd to strcmp please - georgian1 - 12.09.2014

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Params are automatically defined when using a ZCMD command. Use strtok:

https://sampwiki.blast.hk/wiki/Strtok

Although I recommend using sscanf2 instead:

https://sampforum.blast.hk/showthread.php?tid=120356
can you give me already maked code ? sorry for my english