SA-MP Forums Archive
Command 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: Command ID bug (/showthread.php?tid=465227)



Command ID bug - ajam112 - 21.09.2013

well, i had a stupid problem here.

When i going to whisper someone like /w [id] [message]

Example : /w 2 test

It going to whisper id 0, all my command are bugged like this. please help..


Re: Command ID bug - DanishHaq - 21.09.2013

Are you using sscanf to declare the parameters?


Re: Command ID bug - ajam112 - 21.09.2013

i dont know, i just using someone gamemode,


Re: Command ID bug - DanishHaq - 21.09.2013

Don't use that GM then if it's bugged like that. Try a different GM, it will take a long time to fix if it's on every command.


Re: Command ID bug - ajam112 - 21.09.2013

it's rp gamemode.. i dont have another, and only that beast for me


Re: Command ID bug - Konstantinos - 21.09.2013

Would you mind to show us the /w command? I'm afraid that if it's uses sscanf, the plugin + include are old version.


Re: Command ID bug - DanishHaq - 21.09.2013

Ok, try and update your sscanf to the latest version, get it from here: https://sampforum.blast.hk/showthread.php?tid=120356, and then update the sscanf syntax on your script to the newest version too.

Edit: Dayumn, Konstantinos was faster.. again lol.


Re: Command ID bug - ajam112 - 21.09.2013

here is

pawn Код:
CMD:w(playerid, params[])
{
    new giveplayerid, whisper[128];

    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }
    if(sscanf(params, "us[128]", giveplayerid, whisper))
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: (/w)hisper [playerid] [text]");
        return 1;
    }
    if(WatchingTV[playerid] != 0 && PlayerInfo[playerid][pAdmin] < 2)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this while watching TV.");
        return 1;
    }
    if (IsPlayerConnected(giveplayerid))
    {
        if(HidePM[giveplayerid] > 0)
        {
            SendClientMessageEx(playerid, COLOR_GREY, "That player is blocking whispers!");
            return 1;
        }
        new giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128];
        sendername = GetPlayerNameEx(playerid);
        giveplayer = GetPlayerNameEx(giveplayerid);
        if(giveplayerid == playerid)
        {
            if(PlayerInfo[playerid][pSex] == 1) format(string, sizeof(string), "* %s mutters something to himself.", GetPlayerNameEx(playerid));
            else format(string, sizeof(string), "* %s mutters something to herself.", GetPlayerNameEx(playerid));
            return ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        }
        if(ProxDetectorS(5.0, playerid, giveplayerid) || PlayerInfo[playerid][pAdmin] >= 2)
        {
            format(string, sizeof(string), "%s (ID %d) whispers to you: %s", GetPlayerNameEx(playerid), playerid, whisper);

            if(strlen(string) > 92)
            {
                new firstline[128], secondline[128];
                strmid(firstline, string, 0, 88);
                strmid(secondline, string, 88, 128);
                format(firstline, sizeof(firstline), "%s ...", firstline);
                SendClientMessageEx(giveplayerid, COLOR_YELLOW, firstline);
                SendClientMessageEx(giveplayerid, COLOR_YELLOW, secondline);
            }
            else SendClientMessageEx(giveplayerid,COLOR_YELLOW, string);

            format(string, sizeof(string), "You whispered to %s: %s", GetPlayerNameEx(giveplayerid),whisper);
            if(strlen(string) > 92)
            {
                new firstline[128], secondline[128];
                strmid(firstline, string, 0, 88);
                strmid(secondline, string, 88, 128);
                format(firstline, sizeof(firstline), "%s ...", firstline);
                SendClientMessageEx(playerid, COLOR_YELLOW, firstline);
                SendClientMessageEx(playerid, COLOR_YELLOW, secondline);
            }
            else SendClientMessageEx(playerid,COLOR_YELLOW, string);
            return 1;
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
        }
        return 1;
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
    }
    return 1;
}



Re: Command ID bug - Konstantinos - 21.09.2013

It seems fine. Update your sscanf and re-compile your scripts.