PDA

View Full Version : Anti_Speed problem


Akcent_Voltaj
16/09/2012, 04:03 PM
so look it doesent work i put an hack on my server to see and it doesent appear message and doesent kick me..the server restarts..

#define Name:%1(%2) forward %1(%2); public %1(%2)
Name:Antisp(playerid)
{
if(GetPlayerSpeed(playerid) > 210) // if it is above.
{
SendClientMessage(playerid, -1, "<< Anti-Speed: %s a primit Kick de la Anti-Speed >>"); // will be displayed this message
Kick(playerid); // Then will kick the player.
}
return 1;
}

help please!

Akcent_Voltaj
16/09/2012, 04:45 PM
anyone?

doreto
16/09/2012, 04:58 PM
show your "GetPlayerSpeed" function

ViniBorn
16/09/2012, 05:10 PM
Name:Antisp(playerid)
{
if(GetPlayerSpeed(playerid) > 210) // if it is above.
{
SendClientMessage(playerid, -1, "<< Anti-Speed: You are kicked >>"); // will be displayed this message
Kick(playerid); // Then will kick the player.
}
return 1;
}

SuperViper
16/09/2012, 05:29 PM
public OnGameModeInit()
{
SetTimer("Antisp", 2000, 1);
return 1;
}

forward Antisp();
public Antisp()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(GetPlayerSpeed(playerid) > 210) // if it is above.
{
SendClientMessage(playerid, -1, "<< Anti-Speed: You are kicked >>"); // will be displayed this message
Kick(playerid); // Then will kick the player.
}
}

return 1;
}

Akcent_Voltaj
20/09/2012, 12:18 PM
public OnGameModeInit()
{
SetTimer("Antisp", 2000, 1);
return 1;
}

forward Antisp();
public Antisp()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
{
if(GetPlayerSpeed(playerid) > 210) // if it is above.
{
SendClientMessage(playerid, -1, "<< Anti-Speed: You are kicked >>"); // will be displayed this message
Kick(playerid); // Then will kick the player.
}
}

return 1;
}

no message the server restarts!

ikkentim
20/09/2012, 12:44 PM
Use the IsPlayerConnected function before checking speed.

Lordzy
20/09/2012, 12:56 PM
Try this

public OnPlayerUpdate(playerid)
{
if(GetPlayerSpeed(playerid) > 210)
{
SendClientMessage(playerid, 0xFF0000, "Anti-Speed:You're kicked for high speed.");
Kick(playerid);
}
return 1;
}
Not Tested.