SA-MP Forums

SA-MP Forums (
-   Scripting Help (
-   -   zcmd (

Henriquemm 05/07/2019 07:28 PM

The question in question is as follows.
in strcmp would use so

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

and in zcmd would look like?

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!


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.

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");
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

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.