[HELP] sscanf2.0 - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] sscanf2.0 (
/showthread.php?tid=154624)
[HELP] sscanf2.0 -
dcmd_crash - 14.06.2010
pawn Code:
if(strcmp(mCommand, "hide", true) == 0)
{
if(PlayerInfo[playerid][Level] >= 3)
{
new sCommand[4];
if(sscanf(params, "s[20]s[4]",mCommand, sCommand))
{
SendClientMessage(playerid, Red, "USAGE: /my hide [on/off]");
}
else if(strcmp(sCommand, "on", true) == 0)
{
if(PlayerInfo[playerid][Hidden] == 1) return SendClientMessage(playerid, Red, "You are already invisible!");
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][Level] < 3)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
}
}
format(string, sizeof(string), "%s[%d] is now hidden for players", pName(playerid), playerid);
MessageToAdminsEx(playerid, MAD_WHITE, string);
PlayerInfo[playerid][Hidden] = 1;
SendClientMessage(playerid, MANAGEMENT, "* You are now invisible to players.");
return 1;
}
else if(strcmp(sCommand, "off", true) == 0)
{
if(PlayerInfo[playerid][Hidden] == 0) return SendClientMessage(playerid, Red, "You're hide is already off!");
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][Level] < 3)
{
ShowPlayerNameTagForPlayer(i, playerid, false);
SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid)));
}
}
format(string, sizeof(string), "%s[%d] is not invisible anymore.", pName(playerid), playerid);
MessageToAdminsEx(playerid, MAD_WHITE, string);
PlayerInfo[playerid][Hidden] = 0;
SendClientMessage(playerid, MANAGEMENT, "* You are now invisible to players.");
return 1;
}
} else return 0;
}
}
There is my command, which works perfectly, except if you type /my hide and then "on" or "off" nothing at all happens, no messages nothing. Please, can somebody tell me what the fuck I am doing wrong. I have countless other commands like this that just aren't working.... I can't see anything wrong with it.
Re: [HELP] sscanf2.0 -
dcmd_crash - 16.06.2010
BUMP. Somebody's gotta know what the fuck is going on. I don't care if Y_Less himself has to get his ass up in here, need this sorted.
Re: [HELP] sscanf2.0 -
Kyosaur - 16.06.2010
sscanf returns 0 if your string matches your specifiers, so add a ! inside the if statement before the sscanf.
Re: [HELP] sscanf2.0 -
dcmd_crash - 16.06.2010
Quote:
Originally Posted by Kyosaur!!
sscanf returns 0 if your string matches your specifiers, so add a ! inside the if statement before the sscanf.
|
That failed. Didn't even work, lol. Any other solutions?
Re: [HELP] sscanf2.0 -
Dolph - 16.06.2010
Quote:
Originally Posted by _❼_
Quote:
Originally Posted by Kyosaur!!
sscanf returns 0 if your string matches your specifiers, so add a ! inside the if statement before the sscanf.
|
That failed. Didn't even work, lol. Any other solutions?
|
Being a dickhead won't get you help. He tries to help and you dont even say thanks to him for even bothering! Just so you know.
Re: [HELP] sscanf2.0 -
dcmd_crash - 16.06.2010
I wasn't being a dickhead, I just merely forgot to thank him. However, you're retarded. Don't post here unless you have some help (as the topic title says), thanks.
P.S: That's being a dickhead.
Re: [HELP] sscanf2.0 -
dcmd_crash - 17.06.2010
Does anybody on earth know why this isn't working?! I can't do anything until this is fixed!!! I PM'd Y_Less but no reply, as I expected.