13.11.2011, 16:10
So, i can understand that sscanf doesn't work proper with 0.3d (https://sampforum.blast.hk/showthread.php?tid=282902)
I have this command, which used to work fine with 0.3c (using sscanf and zcmd):
Now it just says "This player is not connected" no matter what id is typed.
As mentioned before; this command worked fine with 0.3c.
Is there any way to fix it, or do i have to wait for a new version of sscanf?
Thank you.
I have this command, which used to work fine with 0.3c (using sscanf and zcmd):
pawn Код:
COMMAND:pm(playerid, params[])
{
new pid;
if(sscanf(params, "us[128]", pid, params[2])) return SendClientMessage(playerid, COLOR_SYSTEMRED, "USAGE: /pm <playerid> <message>");
if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) This player is not connected");
if(pid == playerid) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) You can not send private messages to yourself");
if(gPlayerLogged[pid] == 0) return SendClientMessage(playerid, COLOR_NORMALRED, "( ! ) This player is not logged in");
new sender[MAX_PLAYER_NAME], receiver[MAX_PLAYER_NAME], string[129];
GetPlayerName(playerid, sender, sizeof(sender));
GetPlayerName(pid, receiver, sizeof(receiver));
format(string, sizeof(string), "PM from %s (ID:%i): %s", sender, playerid, params[2]);
SendClientMessage(pid, COLOR_YELLOW, string);
PlayerPlaySound(pid, 1085, 0, 0, 0);
format(string, sizeof(string), "PM sent to %s (ID:%i): %s", receiver, pid, params[2]);
SendClientMessage(playerid, COLOR_YELLOW, string);
PlayerPlaySound(playerid, 1085, 0, 0, 0);
return 1;
}
As mentioned before; this command worked fine with 0.3c.
Is there any way to fix it, or do i have to wait for a new version of sscanf?
Thank you.