Others arrest position, help please. -
fabriziobondi - 17.11.2011
Hi,
I have this command:
PHP код:
COMMAND:arresta(playerid,params[]){
new id, string[150], time;
if(PlayerAccount[playerid][Faction]!=FACTION_POLICE) return SendClientMessage(playerid, COLOR_DARKRED,"Non sei un poliziotto in servizio.");
if(PlayerAccount[playerid][CurrentDuty]==0) return SendClientMessage(playerid, COLOR_DARKRED,"Non sei un poliziotto in servizio.");
if (sscanf(params, "ud", id, time)) return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "USA: /arresta [playerid] [tempo]");
if(!PlayerToPoint(15.0, playerid, 1778.6952,-1567.2928,1734.9430)) return SendClientMessage(playerid, COLOR_DARKRED, "Devi essere vicino alla posizione di arresto");
if(id==playerid) return SendClientMessage(playerid, COLOR_DARKRED, "Non puoi arrestarti da solo.");
if(IsPlayerInRangeOfPlayer(playerid, id, 5.0)){
if(PlayerAccount[id][Ammanettato]==0) return SendClientMessage(playerid, COLOR_DARKRED, "Il player deve essere ammanettato.");
if(GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(id)) return SendClientMessage(playerid, COLOR_DARKRED, "Il player non ti и vicino.");
new pout = random(150);
format(string, sizeof(string), "INFO: Hai arrestato con successo %s, sono stati aggiunti %d$ alla tua busta paga.", GetPlayerNameEx(id), pout);
PlayerAccount[playerid][Pay]+=pout;
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
ResetPlayerWeaponsEx(id);
SetPlayerWantedLevel(id, 0);
PlayerAccount[id][JailTime] = time * 60;
format(string, sizeof(string), "Sei stato arrestato! - Tempo Jail: %d secondi.", PlayerAccount[id][JailTime]);
PlayerAccount[id][Jailed]=1;
PlayerAccount[id][Ammanettato]=0;
SendClientMessage(id, COLOR_LIGHTYELLOW2, string);
SetPlayerInterior(id, 6);
TogglePlayerControllable(id,0);
SetPlayerPos(id,1778.6985,-1581.5929,1734.9430);
FadeColorForPlayer(id,0,0,0,0,0,0,0,255,15,0);
LoadingMap[id] = 1;
}
return 1;
}
I need to add others arrest position, how can I do this?
Thank u.
Re: Others arrest position, help please. -
MP2 - 17.11.2011
Explain what you need PROPERLY. What is "add others arrest position" supposed to mean?
Re: Others arrest position, help please. -
fabriziobondi - 18.11.2011
I need to add others jail points.
Re: Others arrest position, help please. -
wumpyc - 18.11.2011
try
PHP код:
switch(random(3))
{
case 0: SetPlayerPos(id,1778.6985,-1581.5929,1734.9430);
case 1:
case 2:
}
Re: Others arrest position, help please. -
Alberto_DR - 18.11.2011
try doing this...
remove
pawn Код:
if(!PlayerToPoint(15.0, playerid, 1778.6952,-1567.2928,1734.9430)) return SendClientMessage(playerid, COLOR_DARKRED, "Devi essere vicino alla posizione di arresto");
then before the actual code add / use this logic
pawn Код:
if(PlayerToPoint(15.0, playerid, 1778.6985, -1581.5929, 1734.9430) || PlayerToPoint(15.0, playerid, x, y, z) || PlayerToPoint(15.0, playerid, x, y, z))
{
// your code here
}
Just add the coordinates to those variables up there
hope it helped