SA-MP Forums Archive
[HELP] ZCMD Anti-WeaponHack - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] ZCMD Anti-WeaponHack (/showthread.php?tid=162831)



[HELP] ZCMD Anti-WeaponHack - Dudits - 24.07.2010

pawn Код:
CMD:wh(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
        if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wh [id]");
        new message[128];
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon1]) SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 1.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon2]) SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 2.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon3]) SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 3.");
        format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);
    }
    return 1;
}
The SendClientMessages after "GetPlayerWeapon" don't show, any suggestions?


Re: [HELP] ZCMD Anti-WeaponHack - iggy1 - 24.07.2010

Maybe this will work using 'd' instaed of 'u' because 'u' can be used for playername or id so it might mess with ReturnPlayerName(playerb). im probably wrong but its worth a try.
pawn Код:
CMD:wh(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
        if(sscanf(params, "d", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wh [id]");
        new message[128];
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon1]) SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 1.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon2]) SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 2.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon3]) SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 3.");
        format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);
    }
    return 1;
}
Iv not tested but no-one else posted so i thought id try help.


Re: [HELP] ZCMD Anti-WeaponHack - Dudits - 24.07.2010

It IS supposed to be "u" because it DOES require his Name/ID.

PLUS: The problem is not here at all.
It does send the line after it
pawn Код:
format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);



Re: [HELP] ZCMD Anti-WeaponHack - iggy1 - 25.07.2010

I was just thinking if ReturnPlayerName(playerb) is passed a name it wont return the players name it will fail. sorry it didnt help.


Re: [HELP] ZCMD Anti-WeaponHack - Dudits - 25.07.2010

I don't really know what's wrong with it, seems to be fine for me... but well, it's not :S


Re: [HELP] ZCMD Anti-WeaponHack - Kar - 25.07.2010

mama mama ma mama mama ma ma my murda

pawn Код:
CMD:wh(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
        if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wh [id]");
        new message[128];
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon1]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 1.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon2]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 2.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon3]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 3.");
        format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);
    }
    return 1;
}



Re: [HELP] ZCMD Anti-WeaponHack - Dudits - 25.07.2010

Quote:
Originally Posted by Kar
Посмотреть сообщение
mama mama ma mama mama ma ma my murda

pawn Код:
CMD:wh(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
        if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wh [id]");
        new message[128];
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon1]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 1.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon2]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 2.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon3]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 3.");
        format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);
    }
    return 1;
}
Still same issue.


Re: [HELP] ZCMD Anti-WeaponHack - Kar - 25.07.2010

this esle its ur playerinfo


pawn Код:
CMD:wh(playerid, params[])
{
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wh [id]");
    if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
    if(IsPlayerConnected(playerb))
    {
        new message[128];
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon1]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 1.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon2]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 2.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon3]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 3.");
        format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);
    }
    return 1;
}



Re: [HELP] ZCMD Anti-WeaponHack - willsuckformoney - 25.07.2010

pawn Код:
CMD:wh(playerid, params[])
{
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /wh [id]");
    if(!PlayerInfo[playerid][pLogged]) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You need to be logged in to excute a command.");
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You are not an admin.");
    if(IsPlayerConnected(playerb))
    {
        new message[128];
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon1]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 1.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon2]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 2.");
        if(GetPlayerWeapon(playerb) != PlayerInfo[playerb][pWeapon3]) return SendClientMessage(playerid, COLOR_YELLOW, "Anti-WH: Weapon is not in Slot 3.");
        format(message, sizeof(message), "Anti-WH: %s was checked for Weapon Hacks.", ReturnPlayerName(playerb));
        SendClientMessageToAll(COLOR_YELLOW, message);
    }
    return 1;
}
EDIT: beated to it..


Re: [HELP] ZCMD Anti-WeaponHack - Kar - 25.07.2010

haha^ well dudits it works? else its ur playerinfo