22.11.2013, 12:41
Inнcio do GameMode:
OnPlayerDeath:
Em seu gamemode deve ter alguma public com timer para verificar se o Player estб preso.
Vocк adiciona nela.
Esse sistema acima nгo salva se o Player Estб, entгo й sу trocar as variбveis TempoPreso, e Preso pelas variбveis do seu GameMode.
pawn Код:
new Preso[MAX_PLAYERS];
new TempoPreso[MAX_PLAYERS];
pawn Код:
if(IsACop(killerid))
{
if(GetPlayerWantedLevel(playerid) == 1)
{
Preso[playerid] = 1;
TempoPreso[playerid] = 180;
SetPlayerWantedLevel(playerid, 0);
SetPlayerPosition(playerid, X, Y, Z);
}
else if(GetPlayerWantedLevel(playerid) == 2)
{
Preso[playerid] = 1;
TempoPreso[playerid] = 360;
SetPlayerWantedLevel(playerid, 0);
SetPlayerPosition(playerid, X, Y, Z);
}
else if(GetPlayerWantedLevel(playerid) == 3)
{
Preso[playerid] = 1;
TempoPreso[playerid] = 540;
SetPlayerWantedLevel(playerid, 0);
SetPlayerPosition(playerid, X, Y, Z);
}
else if(GetPlayerWantedLevel(playerid) == 4)
{
Preso[playerid] = 1;
TempoPreso[playerid] = 720;
SetPlayerWantedLevel(playerid, 0);
SetPlayerPosition(playerid, X, Y, Z);
}
else if(GetPlayerWantedLevel(playerid) == 5)
{
Preso[playerid] = 1;
TempoPreso[playerid] = 900;
SetPlayerWantedLevel(playerid, 0);
SetPlayerPosition(playerid, X, Y, Z);
}
else if(GetPlayerWantedLevel(playerid) == 6)
{
Preso[playerid] = 1;
TempoPreso[playerid] = 1080;
SetPlayerWantedLevel(playerid, 0);
SetPlayerPosition(playerid, X, Y, Z);
}
}
Vocк adiciona nela.
pawn Код:
if(Preso[playerid] >= 1)
{
PlayerInfo[playerid][Tempopreso]--;
}
if(TempoPreso[playerid] <= 1)
{
SetPlayerPosition(playerid, X, Y, Z);
SendClientMessage(playerid, -1, "Livre");
Preso[playerid] = 0;
TempoPreso[playerid] = 0;
}