SA-MP Forums Archive
Bunnyhop command help needed - 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: Bunnyhop command help needed (/showthread.php?tid=409544)



Bunnyhop command help needed - UnknownGamer - 21.01.2013

pawn Код:
CMD:bhstop(playerid, params[])
{
    new giveplayer;
    if(!sscanf(params, "i", giveplayer, "Myusername", true)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You need to be **!");
    if(sscanf(params, "i", giveplayer, "Myusername", true))
    {
        bhstop[playerid] = 1;
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "[ADMIN]: You have stopped the Bunnyhopper!");
    }
    return 1;
}
That should only work for username "Myusername" right?


Re: Bunnyhop command help needed - Threshold - 22.01.2013

I don't know why you're using an integer value in sscanf in the first place 0_o.

pawn Код:
CMD:bhstop(playerid, params[])
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    if(strcmp(name, "Myusername", false) != 0) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "* You need to be **!");
    bhstop[playerid] = 1;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "[ADMIN]: You have stopped the Bunnyhopper!");
    return 1;
}