SA-MP Forums Archive
Anti-Cbug system slaps player ID 0 - 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: Anti-Cbug system slaps player ID 0 (/showthread.php?tid=334414)



slaps player ID 0 - captainjohn - 14.04.2012

How can I make this not slap the player who is ID 0.

I want it to slap the player that is doing the C-bugging and not ID 0.

pawn Код:
forward OnPlayerCBug(playerid);
public OnPlayerCBug(playerid) {
    new playername[MAX_PLAYER_NAME];
    new player1;
    GetPlayerName(playerid, playername, sizeof(playername));
    new str2[128];
    new givenid;
    format(str2, sizeof(str2), "Automatic system has slapped %s for Crouch bugging with weapon (%s!)", playername, aWeaponNames[WeaponID[playerid]]);
    new Float:Health; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-10);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(givenid, x, y, z);
    SetPlayerPos(givenid, x, y, z+5);
    PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);
    SendClientMessageToAll(COLOR_RED, str2);
    CheckCrouch[playerid] = 0;
    return 1;
}



Respuesta: slaps player ID 0 - [DOG]irinel1996 - 14.04.2012

Here you have:
pawn Код:
forward OnPlayerCBug(playerid);
public OnPlayerCBug(playerid) {
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    new str2[128];
    format(str2, sizeof(str2), "Automatic system has slapped %s for Crouch bugging with weapon (%s!)", playername, aWeaponNames[WeaponID[playerid]]);
    new Float:Health; GetPlayerHealth(playerid,Health); SetPlayerHealth(playerid,Health-10);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z+5);
    PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
    SendClientMessageToAll(COLOR_RED, str2);
    CheckCrouch[playerid] = 0;
    return 1;
}
Best regards!


Re: Anti-Cbug system slaps player ID 0 - captainjohn - 14.04.2012

Cheers mate ^