10.04.2012, 17:48
pawn Код:
CMD:arreteeri(playerid, params[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(i, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
if(gTeam[playerid] == 2)
{
if(gTeam[i] == 0 && 1)
{
if(GetPlayerWantedLevel(i) >= 2)
{
new mangijale[64], politseile[128], vNimi[MAX_PLAYER_NAME], wantedlevel;
wantedlevel = GetPlayerWantedLevel(i);
new rahatrahv = 1000*wantedlevel + random(800);
GivePlayerMoney(i, -rahatrahv);
SetTimerEx("Vangla", 1000*10*wantedlevel, false, "i");
SetPlayerVirtualWorld(i, 2);
SetPlayerInterior(i, 6);
SetPlayerPos(i, 264.2021,77.7526,1001.0391);
GetPlayerName(i, vNimi, sizeof(vNimi));
format(mangijale, sizeof(mangijale), "PCPD: Sind vangistati siia ning said trahvi %d$.", rahatrahv);
SendClientMessage(i, C_RED, mangijale);
format(politseile, sizeof(politseile), "VANGIMAJA: Sa vangistasid kasutaja %s seaduserikkumise eest!", vNimi);
SendClientMessage(playerid, C_BLUE, politseile);
}
SendClientMessage(playerid, C_RED, "SERVER: Antud mдngijal ei ole ьle 2 tдrni tagaotsitavust!");
}
SendClientMessage(playerid, C_RED, "SERVER: Kaastццtajaid ei tohi vangistada!");
}
SendClientMessage(playerid, C_RED, "SERVER: Sa ei ole politseinik!");
}
}
}
return 1;
}