SA-MP Forums Archive
HELP WITH COMMAND - 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: HELP WITH COMMAND (/showthread.php?tid=635996)



HELP WITH COMMAND - HellixBG - 17.06.2017

Hello!

Can someone make this command with sscanf2?

Code:
  dcmd_gangshow(playerid,params[]) {
 #pragma unused params
    if(inDM[playerid] == 1) return SendClientMessage(playerid,COLOR_RED,"Не можеш да използваш тази команда, докато си в DM зона!(/leavedm)");
 if(PGang[playerid] >0)
 {
 if(GangHide[playerid]==0) {
        GangHide[playerid]=1;
        Delete3DTextLabel(label[playerid]);
        SendClientMessage(playerid,COLOR_LIGHT_GREEN,"Вече няма да има бандата пред ника ти!");
    } else {
        GangHide[playerid]=0;
        label[playerid] = Create3DTextLabel(GName[PGang[playerid]], 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0);
  Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7); // X, Y , Z
  SendClientMessage(playerid,COLOR_LIGHT_GREEN,"Вече ще има бандата пред ника ти!");
    }
    }
    return 1;
}
Thanks in advance!


Re: HELP WITH COMMAND - Meller - 17.06.2017

You're not using params at all.. as well as you're not checking if a variable contains that or that.

I don't see a need for SSCANF in this case.


Re: HELP WITH COMMAND - HellixBG - 17.06.2017

Quote:
Originally Posted by Meller
View Post
You're not using params at all.. as well as you're not checking if a variable contains that or that.

I don't see a need for SSCANF in this case.
Meller, Everything in my gamemode is in sscanf every command so I cannot do it myself thats why I need help for this command and Im beginner in scripting


Re: HELP WITH COMMAND - Meller - 17.06.2017

Quote:
Originally Posted by HellixBG
View Post
Meller, Everything in my gamemode is in sscanf every command so I cannot do it myself thats why I need help for this command and Im beginner in scripting
Yeah, but this command doesn't require SSCANF. I believe you've not got a clear explanation of what SSCANF actually is, so here's a blunt explanation:

SSCANF in PAWN can separate a variable to give out different variables' parts.

Imagine you've got a command like uh... /kick, it's usually /kick playerid reason
And when you're using a command in PAWN, it spits out params, in this case, so with SSCANF you can separate params to give out the playerid and the reason. It'd work like this:

sscanf(params, "is[86]", playerid, reason);

The "i" is an integer which in this case is playerid.
The "s[86]" is for the reason, in this case, the 86 is the string limit, in your command you just type the command without any params after, giving no need for SSCANF to separate the string.


Re: HELP WITH COMMAND - Sew_Sumi - 17.06.2017

And remove that bullshit pragma...