SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Scripting Help (https://forum.sa-mp.com/forumdisplay.php?f=12)
-   -   zcmd (https://forum.sa-mp.com/showthread.php?t=667750)

Henriquemm 05/07/2019 07:28 PM

zcmd
 
The question in question is as follows.
in strcmp would use so
Code:

format(gstring,sizeof(gstring),"/logar %s",inputtext);
            OnPlayerCommandText(playerid,gstring);

and in zcmd would look like?
Code:

format(gstring,sizeof(gstring),"/logar %s",inputtext);
            cmd_logar(playerid, "");

I think it would not work because in strcmp it checks the / logar command plus inputtext in case what the player typed and performs the command, but as it has parameters in zcmd I do not know how to make the same code work ..

If you can help, thank you!

thanks!
thanks!..

Symon 05/07/2019 07:32 PM

Re: zcmd
 
I don't know what "logar" means but params in zcmd works in this way:

pawn Code:
CMD:report(playerid, params[])
{
    new id, reason[128];

    if(sscanf(params, "rs[128]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /report [playerid/name] [reason]");

    SendClientMessage(playerid, -1, "You have reported successfully this player.");
    return 1;
}

You need sscanf tho.

https://forum.sa-mp.com/showthread.php?t=570927

Henriquemm 05/07/2019 07:47 PM

Re: zcmd
 
well, that would not be it
would have some way to run the function like this?
look well
HTML Code:

formato (gstring, sizeof (gstring), "%s", inputtext);
            cmd_logar (playerid, "inputtext");
or
formato (gstring, sizeof (gstring), "%s", inputtext);
            cmd_logar (playerid, "gstring");


TheToretto 05/07/2019 09:54 PM

Re: zcmd
 
pawn Code:
cmd_logar(playerid, gstring);

1sbedx 05/07/2019 09:59 PM

Re: zcmd
 
https://forum.sa-mp.com/showpost.php...43&postcount=2

Gammix 06/07/2019 03:23 PM

Re: zcmd
 
pawn Code:
cmd_logar(playerid, inputtext);


All times are GMT. The time now is 07:35 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.