HELP WITH COMMAND
#1

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!
Reply
#2

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.
Reply
#3

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
Reply
#4

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.
Reply
#5

And remove that bullshit pragma...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)