Anti-Cbug system slaps player ID 0
#1

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;
}
Reply
#2

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!
Reply
#3

Cheers mate ^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)