sscanf id bug
#1

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

try "i"
Reply
#3

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

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; 
}
Reply
#5

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)