SA-MP Forums Archive
Others arrest position, help please. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Others arrest position, help please. (/showthread.php?tid=297821)



Others arrest position, help please. - fabriziobondi - 17.11.2011

Hi,
I have this command:

PHP код:
COMMAND:arresta(playerid,params[]){
    new 
idstring[150], time;
    if(
PlayerAccount[playerid][Faction]!=FACTION_POLICE) return SendClientMessage(playeridCOLOR_DARKRED,"Non sei un poliziotto in servizio.");
    if(
PlayerAccount[playerid][CurrentDuty]==0) return SendClientMessage(playeridCOLOR_DARKRED,"Non sei un poliziotto in servizio.");
    if (
sscanf(params"ud"idtime)) return SendClientMessage(playeridCOLOR_LIGHTYELLOW2"USA: /arresta [playerid] [tempo]");
    if(!
PlayerToPoint(15.0playerid1778.6952,-1567.2928,1734.9430)) return SendClientMessage(playeridCOLOR_DARKRED"Devi essere vicino alla posizione di arresto");
    if(
id==playerid) return SendClientMessage(playeridCOLOR_DARKRED"Non puoi arrestarti da solo.");
    if(
IsPlayerInRangeOfPlayer(playeridid5.0)){
    if(
PlayerAccount[id][Ammanettato]==0) return SendClientMessage(playeridCOLOR_DARKRED"Il player deve essere ammanettato.");
    if(
GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(id)) return SendClientMessage(playeridCOLOR_DARKRED"Il player non ti и vicino.");
    new 
pout random(150);
    
format(stringsizeof(string), "INFO: Hai arrestato con successo %s, sono stati aggiunti %d$ alla tua busta paga."GetPlayerNameEx(id), pout);
    
PlayerAccount[playerid][Pay]+=pout;
    
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
    
ResetPlayerWeaponsEx(id);
    
SetPlayerWantedLevel(id0);
    
PlayerAccount[id][JailTime] = time 60;
    
format(stringsizeof(string), "Sei stato arrestato! - Tempo Jail: %d secondi."PlayerAccount[id][JailTime]);
    
PlayerAccount[id][Jailed]=1;
    
PlayerAccount[id][Ammanettato]=0;
    
SendClientMessage(idCOLOR_LIGHTYELLOW2string);
    
SetPlayerInterior(id6);
    
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 
0SetPlayerPos(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