15.11.2013, 20:53
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
+ Rep
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(playerid)) || arr_Towing[playerid] != INVALID_VEHICLE_ID || arr_Wrecking[playerid] != INVALID_VEHICLE_ID)
{
new towed;
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) 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(playerid)))
{
SendClientMessageEx(playerid, COLOR_GRAD1, "The impound administration could not find any registration on the vehicle and has returned it.");
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
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(playerid)))
{
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
}
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(iTargetOwner),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;
}
AddPlayerClass(6,1475.1866,-1749.3876,3285.2859,181.6267,0,0,0,0,0,0); // Impound cordinates
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 pawn Код:
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. |
Create3DTextLabel("Impound Yard \n Type /impound to impound a vehicle",0xFFFF00AA, -65.3189,-1119.7914,1.0781, 20,0,1);
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 pawn Код:
Example Create3DTextLabel("Impound Yard \n Type /impound to impound a vehicle",0xFFFF00AA, -65.3189,-1119.7914,1.0781, 20,0,1); |