14.12.2010, 22:57
Hi
This is maybe the last thing i ask about before ill take a break from scripting. (I will maybe ask about a bute thing later)
...
Lets say, When "ME" driveby "HIM" then "ME" auto jailed... but "HIM" get the 'jail time countdown' and "ME(who is in jail)" dont get the countdown text
This is maybe the last thing i ask about before ill take a break from scripting. (I will maybe ask about a bute thing later)
...
Lets say, When "ME" driveby "HIM" then "ME" auto jailed... but "HIM" get the 'jail time countdown' and "ME(who is in jail)" dont get the countdown text
pawn Код:
#include <a_samp>
new JCD, Counter = 120;
forward JailCountDown(playerid, killerid);
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
KillTimer(JCD);
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);
JCD = SetTimer("JailCountDown", 1000, true);
return 1;
}
}
return 1;
}
pawn Код:
public JailCountDown(playerid, killerid)
{
new string[128];
Counter--;
format(string, sizeof(string), "~DRIVEBY JAIL, TIME: %d",Counter);
GameTextForPlayer(killerid, string, 3000,6);
if(Counter == 0)
{
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);
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
KillTimer(JCD);
return 1;
}