14.12.2010, 23:35
pawn Код:
#include <a_samp>
new JCD[YOUR_MAX_SLOTS],Counter[YOUR_MAX_SLOTS];
forward JailCountDown(killerid);
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerState(killerid) == 2)
{
if(!IsPlayerInAnyVehicle(playerid))
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(killerid, playername, sizeof(playername));
new string[128];
//RemovePlayerFromVehicle(killerid);
ResetPlayerWeapons(killerid);
SetCameraBehindPlayer(killerid);
SetPlayerInterior(killerid,3);
SetPlayerPos(killerid,194.0873,175.3850,1003.0234);
SetPlayerFacingAngle(killerid,20.7011);
format(string, sizeof(string), "%s(%d) Do NOT Driveby",playername ,killerid);
SendClientMessageToAll(0xFF7F50AA, string);
if(JCD[killerid]) KillTimer(JCD[killerid]);
Counter[killerid]=seconds;
JCD[killerid] = SetTimerEx("JailCountDown", 1000, true, "d", killerid);
return 1;
}
}
return 1;
}
public JailCountDown(killerid)
{
new string[128];
format(string, sizeof(string), "~DRIVEBY JAIL, TIME: %d",Counter[killerid]);
GameTextForPlayer(killerid, string, 3000,6);
Counter[killerid]--;
if(!Counter[killerid])
{
new killername[MAX_PLAYER_NAME];
GetPlayerName(killerid, killername, sizeof(killername));
SetPlayerInterior(killerid,3);
SetPlayerPos(killerid,210.5272,146.3341,1003.0234);
SetPlayerFacingAngle(killerid,179.4662);
SetCameraBehindPlayer(killerid);
format(string, sizeof(string), "%s(%d) Has been auto-released from Drivebyjail. Time Served: 120 seconds",killername ,killerid);
SendClientMessageToAll(0xFF7F50AA, string);
KillTimer(JCD[killerid]);
JCD[killerid]=0;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(JCD[playerid]) KillTimer(JCD[playerid]);
JCD[playerid]=0;
return 1;
}