16.06.2010, 08:01
Финальная рабочая версия! Используйте на здоровье
Разработка/Модификации: stepmex, Raen
Разработка/Модификации: stepmex, Raen
pawn Code:
#include <a_samp>
new key[MAX_PLAYERS];
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerConnect(playerid)
{
key[playerid] = INVALID_VEHICLE_ID;
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
key[playerid] = vehicleid;
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(oldkeys != KEY_SECONDARY_ATTACK && newkeys == 0 && key[playerid] != INVALID_VEHICLE_ID && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)key[playerid] = INVALID_VEHICLE_ID;
if(key[playerid] != GetPlayerVehicleID(playerid) && IsPlayerInAnyVehicle(playerid) && key[playerid] != INVALID_VEHICLE_ID)
{
new string[128];
GetPlayerName(playerid,string,MAX_PLAYER_NAME);
format(string, sizeof(string), "%s кикнут с сервера, причина: ТелепортХак",string);
SendClientMessageToAll(0xAA3333AA, string);
Kick(playerid);
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if((newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER))
{
if(key[playerid] != GetPlayerVehicleID(playerid))
{
new string[128];
GetPlayerName(playerid,string,MAX_PLAYER_NAME);
format(string, sizeof(string), "%s кикнут с сервера, причина: ТелепортХак",string);
SendClientMessageToAll(0xAA3333AA, string);
Kick(playerid);
}
return 1;
}
if((oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) && key[playerid] != INVALID_VEHICLE_ID)key[playerid] = INVALID_VEHICLE_ID;
return 1;
}