SA-MP Forums Archive
sscanf id bug - 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: sscanf id bug (/showthread.php?tid=609365)



sscanf id bug - Uberanwar - 11.06.2016

Hey everyone, I have the latest SA-MP package & latest sscanf package (from https://sampforum.blast.hk/showthread.php?tid=602923) but I'm still experiencing id bugs! I don't know why, the commands should be working properly..
Sometimes id 0 bug, sometimes id 2 bug. I don't get it why... so annoying.

Here's one of my command.
PHP код:
CMD:pm(playeridparams[])
{
    new 
str[128], text[128], targetid;
    if(
sscanf(params"rs[128]"targetidtext)) return SendClientMessage(playerid, -1"{8EB2D6}SERVER:{FFFFFF} /pm [player] [text]");
    if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1"{8EB2D6}SERVER:{FFFFFF} Player isn't connected!");
    
format(strsizeof(str), "PM to %s (%d): %s"GetName(targetid), targetidtext);
    
SendClientMessage(playerid0xE0E800FFstr);
    
format(strsizeof(str), "PM from %s (%d): %s"GetName(playerid), playeridtext);
    
SendClientMessage(targetid0xE8C900FFstr);
    return 
true;

I've tried "u" but its still the same.


Re: sscanf id bug - K0P - 11.06.2016

try "i"


Re: sscanf id bug - Uberanwar - 11.06.2016

Quote:
Originally Posted by K0P
Посмотреть сообщение
try "i"
That doesn't make any sense.

i, d Integer 1, 42, -10
c Character a, o, *
l Logical true, false
b Binary 01001, 0b1100
h, x Hex 1A, 0x23
o Octal 045 12
n Number 42, 0b010, 0xAC, 045
f Float 0.7, -99.5
g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
u User name/id (bots and players) ******, 0
q Bot name/id ShopBot, 27
r Player name/id ******, 42


Re: sscanf id bug - sampkinq - 11.06.2016

Try this.

Код:
CMD:pm(playerid, params[]) 
{ 
    new str[128], text[128], targetid; 
    if(sscanf(params, "us", targetid, text)) return SendClientMessage(playerid, -1, "{8EB2D6}SERVER:{FFFFFF} /pm [player] [text]"); 
    if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1, "{8EB2D6}SERVER:{FFFFFF} Player isn't connected!"); 
	if(playerid == targetid) return SendClientMessage(playerid,-1,"{FF0000}You can't pm yourself.");
    format(str, sizeof(str), "PM to %s (%d): %s", GetName(targetid), targetid, text); 
    SendClientMessage(playerid, 0xE0E800FF, str); 
    format(str, sizeof(str), "PM from %s (%d): %s", GetName(playerid), playerid, text); 
    SendClientMessage(targetid, 0xE8C900FF, str); 
    return true; 
}



Re: sscanf id bug - moura98 - 11.06.2016

@edit
try download this version:
https://sampforum.blast.hk/showthread.php?tid=570927


Re: sscanf id bug - Uberanwar - 24.06.2016

I'm still experiencing it. Everythings up to date! What seems to be wrong? Ugh
Other sscanf users do u have any issues?