GTAOnline.net

San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: .:: Miguel .:: le 23 Octobre 2011, 20:15:24

Titre: Detecté munition
Posté par: .:: Miguel .:: le 23 Octobre 2011, 20:15:24
Salut,
Je créé un serveur avec anti-cheat mais j'aimerait detecté les munition alors j'ai fait

#define MAX_ARME_MUNITION 350
SetTimer("CheatArmeMunition",1000,1);
public ArmeCheatMunition()
{
for(new i=0;i < MAX_PLAYERS;i++)
{
    if(IsPlayerConnected(i) && GetPlayerWeaponData(i) >= MAX_ARME_MUNITION)
    {
    new nom[MAX_PLAYER_NAME],str[128];
    GetPlayerName(i,nom,sizeof(nom));
   
    if(!(strcmp("Juan_Wayne",nom) == 0 || strcmp("Rico_Sanchez",nom) == 0 ))
{
    format(str,sizeof(str),"[ANTI-CHEAT] %s à été kické par l'ANTI-CHEAT, Raison : Cheat Arme.",nom);
    SendClientMessageToAll(0xFFF000000,str);
    print(str);
        Kick(i);
}

}

}
}

Mais sa marche pas :/
Titre: Re : Detecté munition
Posté par: Ssk le 23 Octobre 2011, 21:09:07
Tu utilises mal ta fonction GetPlayerWeaponData, utilises plutôt celle la GetPlayerAmmo (http://wiki.sa-mp.com/wiki/GetPlayerAmmo)