PDA

View Full Version : Impound


Drago987
15/11/2013, 08:53 PM
I Just wanna know how to change the impound lot ? like when you do /impound the car spawns at the place where i want ,can anyone help me with it ?
+ Rep

***Niko***
15/11/2013, 08:55 PM
Do you have /apark? just make it like /apark but set it like IsACop or what is your variable,and add is player range to that point (impound).

Drago987
15/11/2013, 08:57 PM
what i mean is that i want to change the impound lot location ,the place where the car spawn when a mechanic do /impound

ReD_DeVi
15/11/2013, 09:00 PM
Do you mean how to park?

Drago987
15/11/2013, 09:02 PM
no man ,i mean this command

CMD:impound(playerid, params[]) {
switch(PlayerInfo[playerid][pMember]) {
case 1, 2, 7, 14, 15, 17: {
if(!IsAtImpoundingPoint(playerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You are not near the impound point, you can't impound!");
return 1;
}
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid)) || arr_Towing[playerid] != INVALID_VEHICLE_ID || arr_Wrecking[playerid] != INVALID_VEHICLE_ID)
{
new towed;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid))) towed = GetVehicleTrailer(GetPlayerVehicleID(playerid));
if(arr_Towing[playerid] != INVALID_VEHICLE_ID) towed = arr_Towing[playerid];
if(arr_Wrecking[playerid] != INVALID_VEHICLE_ID) towed = arr_Wrecking[playerid];

new
iVehType,
iVehIndex,
iTargetOwner,
iVehTowed = towed;

if(!GetVehicleModel(iVehTowed)) {
return SendClientMessageEx(playerid, COLOR_GREY, "The vehicle in tow has been desynced and therefore cannot be impounded.");
}
foreach(Player, i) {
iVehIndex = GetPlayerVehicle(i, iVehTowed);
if(iVehIndex != -1) {
iVehType = 1;
iTargetOwner = i;
break;
}
}
if(!iVehType) {
for(new i; i < MAX_FAMILY; ++i) {
iVehIndex = GetGangVehicle(i, iVehTowed);
if(iVehIndex != -1) {
iVehType = 2;
iTargetOwner = i;
break;
}
}
}
switch(iVehType) {
case 0, 2: {
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid)))
{
SendClientMessageEx(playerid, COLOR_GRAD1, "The impound administration could not find any registration on the vehicle and has returned it.");
DetachTrailerFromVehicle(GetPlayerVehicleID(player id));

}
if(arr_Wrecking[playerid] != INVALID_VEHICLE_ID || arr_Towing[playerid] != INVALID_VEHICLE_ID )
{
SendClientMessageEx(playerid, COLOR_GRAD1,"You have detached the vehicle that you were towing from the flatbed.");
playerveh[playerid] = INVALID_VEHICLE_ID;
KillTimer(TimerATACH[playerid]);
DestroyObject(GetPVarInt(playerid, "WreckingGate"));
DeletePVar(playerid, "WreckingGate");
}
SetVehiclePos(iVehTowed, 0, 0, 0); // Attempted desync fix
SetVehicleToRespawn(iVehTowed);
}
case 1: {

PlayerVehicleInfo[iTargetOwner][iVehIndex][pvImpounded] = 1;
PlayerVehicleInfo[iTargetOwner][iVehIndex][pvId] = INVALID_PLAYER_VEHICLE_ID;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(p layerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(player id));

}
if(arr_Wrecking[playerid] != INVALID_VEHICLE_ID || arr_Towing[playerid] != INVALID_VEHICLE_ID)
{
playerveh[playerid] = INVALID_VEHICLE_ID;
KillTimer(TimerATACH[playerid]);
DestroyObject(GetPVarInt(playerid, "WreckingGate"));
DeletePVar(playerid, "WreckingGate");
}
SetVehiclePos(iVehTowed, 0, 0, 0); // Attempted desync fix
DestroyVehicle(iVehTowed);

--PlayerCars;

new
szMessage[96];

format(szMessage, sizeof(szMessage),"* You have impounded %s's %s.",GetPlayerNameEx(iTargetOwner), VehicleName[PlayerVehicleInfo[iTargetOwner][iVehIndex][pvModelId] - 400]);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);

format(szMessage, sizeof(szMessage), "Your %s has been impounded. You may release it at the DMV in City Hall.", VehicleName[PlayerVehicleInfo[iTargetOwner][iVehIndex][pvModelId] - 400]);
SendClientMessageEx(iTargetOwner, COLOR_LIGHTBLUE, szMessage);

format(szMessage, sizeof(szMessage), "DISPATCH: %s has impounded %s's %s ($%i unpaid tickets).", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetOwner), VehicleName[PlayerVehicleInfo[iTargetOwner][iVehIndex][pvModelId] - 400], PlayerVehicleInfo[iTargetOwner][iVehIndex][pvTicket]);
SendRadioMessage(PlayerInfo[playerid][pMember], RADIO, szMessage);

format(szMessage, sizeof(szMessage), "Impound: %s has impounded %s's %s.",GetPlayerNameEx(playerid),GetPlayerNameEx(iTarget Owner),VehicleName[PlayerVehicleInfo[iTargetOwner][iVehIndex][pvModelId] - 400]);
ABroadCast(COLOR_YELLOW, szMessage, 2);
Log("logs/impound.log", szMessage);
}
/*case 2: {

new
szMessage[29 + MAX_PLAYER_NAME];

format(szMessage, sizeof(szMessage),"* You have impounded %s's %s.",FamilyInfo[iTargetOwner][FamilyName], GetVehicleName(iVehTowed));
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMessage);

format(szMessage, sizeof(szMessage), "Your %s has been impounded. You may release it at the DMV in City Hall.", GetVehicleName(iVehTowed));
SendNewFamilyMessage(iTargetOwner, COLOR_LIGHTBLUE, szMessage);

FamilyVehicleInfo[iTargetOwner][iVehIndex][fvImpounded] = 1;
FamilyVehicleInfo[iTargetOwner][iVehIndex][fvId] = INVALID_VEHICLE_ID;
DestroyVehicle(iVehTowed);
}*/
}
arr_Towing[playerid] = INVALID_VEHICLE_ID;
arr_Wrecking[playerid] = INVALID_VEHICLE_ID;
}
}
default: SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
}
return 1;
}

when a RR or A Cop do it ,the car which got impounded spawns somewhere which is the impound lot ,what i want is to change that impound lot

***Niko***
15/11/2013, 09:05 PM
Well then go ingame,go to place where is your new "impound" write /save Impound cordinates
then go to your documents/GTA San Andreas User Files/SAMP/savedpositions
When you open savedpositions.txt you will see something like this

AddPlayerClass(6,1475.1866,-1749.3876,3285.2859,181.6267,0,0,0,0,0,0); // Impound cordinates

take X,Y,Z cordinates from that code wich is

example:
AddPlayerClass(6,1475.1866,-1749.3876,3285.2859,181.6267,0,0,0,0,0,0);

Then open your pawno use "ctrl+f" write "/impound"

In the command you will see something like if(PlayerToPoint(15,playerid,1475.1866,-1749.3876,3285.2859))
Replace it with new cordinates.


EDIT: Just saw you posted command till i wrote this, find "Public IsAtImpoundingPoint" and change cordinates.

ReD_DeVi
15/11/2013, 09:07 PM
Well then go ingame,go to place where is your new "impound" write /save Impound cordinates
then go to your documents/GTA San Andreas User Files/SAMP/savedpositions
When you open savedpositions.txt you will see something like this

AddPlayerClass(6,1475.1866,-1749.3876,3285.2859,181.6267,0,0,0,0,0,0); // Impound cordinates

take X,Y,Z cordinates from that code wich is

example:
AddPlayerClass(6,1475.1866,-1749.3876,3285.2859,181.6267,0,0,0,0,0,0);

Then open your pawno use "ctrl+f" write "/impound"

In the command you will see something like if(PlayerToPoint(15,playerid,1475.1866,-1749.3876,3285.2859))
Replace it with new cordinates.


EDIT: Just saw you posted command till i writed this, find "Public IsAtImpoundingPoint" and change cordinates.

Hope he understood

Drago987
15/11/2013, 09:21 PM
Look ,this is the ImpoundingPoint ,which i can /impound at
http://im40.gulfup.com/1FIHv.png
And this is the Place where the cars spawns when it get impounded (( which i want to change ))
http://im42.gulfup.com/or34D.png
i hope you guys understand what i mean :)

***Niko***
15/11/2013, 09:30 PM
i explaned you all how to change cordinate find "Public IsAtImpoundingPoint" and you will see cordinates there
about Label use "ctrl+f" write Impound Yard,you will see something like this

Create3DTextLabel("Impound Yard \n Type /impound to impound a vehicle",0xFFFF00AA, -65.3189,-1119.7914,1.0781, 20,0,1);
change cordinates wich is

Example
Create3DTextLabel("Impound Yard \n Type /impound to impound a vehicle",0xFFFF00AA, -65.3189,-1119.7914,1.0781, 20,0,1);

Drago987
15/11/2013, 09:39 PM
i explaned you all how to change cordinate find "Public IsAtImpoundingPoint" and you will see cordinates there
about Label use "ctrl+f" write Impound Yard,you will see something like this

Create3DTextLabel("Impound Yard \n Type /impound to impound a vehicle",0xFFFF00AA, -65.3189,-1119.7914,1.0781, 20,0,1);
change cordinates wich is

Example
Create3DTextLabel("Impound Yard \n Type /impound to impound a vehicle",0xFFFF00AA, -65.3189,-1119.7914,1.0781, 20,0,1);
That will just change the place where i can do /impound not the impound lit where the cars spawn
Any other ideas ?

Drago987
16/11/2013, 07:34 AM
Bump !!