hallo,
ich wollte ein Anti Bunnyhop System einfügen aber es kam beim einruckeln ein error udn ein Warning
C:\Users\ArcticbytesRL\Desktop\MrM Original\gamemodes\mrm.pwn(56853) : warning 209: function "OnPlayerKeyStateChange" should return a value
C:\Users\ArcticbytesRL\Desktop\MrM Original\gamemodes\mrm.pwn(56854) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
if(PRESSED(KEY_CROUCH))
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(GetPVarInt(playerid, "CBugCheck") == 1 && (GetPlayerWeaponSlot(playerid) == 2 || GetPlayerWeaponSlot(playerid) == 3 || GetPlayerWeaponSlot(playerid) == 6))
{
SafeKillTimer(cbugtimer[playerid]);
SetPVarInt(playerid, "CBugCheck", 0);
GivePVarInt(playerid, "CBugWarnings", 1);
if(GetPVarInt(playerid, "CBugWarnings") == 4)
{
SendClientMessageToAllF(DRED, "%s(%d) wurde wegen c-bugging gekickt.", ReturnPlayerName(playerid), playerid);
Create1VarTimerEx(kicktimer[playerid], "KickPlayer", 500, false, "d", playerid);
}
else if(GetPVarInt(playerid, "CBugWarnings") < 4)
{
SafeKillTimer(cbugcooldowntimer[playerid]);
CreateVarTimerEx(cbugcooldowntimer[playerid], "CBugCoolDown", 10000, false, "d", playerid);
SendClientMessage(playerid, DRED, "C-bugge nicht wieder, sonst wirst du gekickt!");
//Hier kann man noch eine Nachricht für nur Admins einfügen.
//Beispiel: SendClientMessageToAdminsF(DRED, "%s(%d) wurde beim c-buggen erwischt.", ReturnPlayerName(playerid), playerid);
}
}
}
}
if(PRESSED(KEY_FIRE)) //Kann ausgeführt werden, während man die Feuer Taste gedrückt hält
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(GetPlayerWeaponSlot(playerid) == 2 || GetPlayerWeaponSlot(playerid) == 3 || GetPlayerWeaponSlot(playerid) == 6)
{
SafeKillTimer(cbugtimer[playerid]);
SetPVarInt(playerid, "CBugCheck", 1);
CreateVarTimerEx(cbugtimer[playerid], "UnCheckPlayerCBug", 300, false, "d", playerid);
}
}
}
if(RELEASED(KEY_FIRE)) //Kann ausgeführt werden, während man die Feuer Taste losgelassen hat.
{
SetPVarInt(playerid, "IsShooting", 0);
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
if(GetPlayerWeaponSlot(playerid) == 2 || GetPlayerWeaponSlot(playerid) == 3 || GetPlayerWeaponSlot(playerid) == 6)
{
SafeKillTimer(cbugtimer[playerid]);
SetPVarInt(playerid, "CBugCheck", 1);
CreateVarTimerEx(cbugtimer[playerid], "UnCheckPlayerCBug", 300, false, "d", playerid);
}
}
}
}
return 1;
}
Mfg