
Untitled
By: a guest on
Jul 17th, 2012 | syntax:
PAWN | size: 1.69 KB | hits: 30 | expires: Never
#define GOTOGPLAYERCAR 19104 //At the top of the script.
if(dialogid == GOTOGPLAYERCAR)//Under public OnDialogResponse
{
if(response == 1)
{
for(new i = 0; i < MAX_GANG_VEHICLES; i++)
{
if(listitem == i)
{
new Float: carPos[3], id = GetPVarInt(playerid, "gangaffectedcarTP");
if(FamilyVehicleInfo[id][i][fvId] != INVALID_PLAYER_VEHICLE_ID)
{
GetVehiclePos(FamilyVehicleInfo[id][i][fvId], carPos[0], carPos[1], carPos[2]);
SetPlayerVirtualWorld(playerid,GetVehicleVirtualWorld(FamilyVehicleInfo[id][i][fvId]));
SetPlayerInterior(playerid,0);
SetPlayerPos(playerid, carPos[0], carPos[1], carPos[2]);
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can not teleport to a empty/impounded slot.");
}
}
}
}
}
CMD:ggotocar(playerid, params[]) //At CMD area, outside of all publics.
{
new f;
if(sscanf(params,"d",f)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ggotocar [Faction ID]");
new vstring[1024];
for(new i = 0; i < MAX_GANG_VEHICLES; i++)
{
if(FamilyVehicleInfo[f][i][fvId] != INVALID_VEHICLE_ID)
{
format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[FamilyVehicleInfo[f][i][fvModelId] - 400]);
}
else if(FamilyVehicleInfo[f][i][fvImpounded] == 1) {
format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[FamilyVehicleInfo[f][i][fvModelId] - 400]);
}
else
{
format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
}
}
SetPVarInt(playerid, "gangaffectedcarTP", f);
return ShowPlayerDialog(playerid, GOTOGPLAYERCAR, DIALOG_STYLE_LIST, "Gang Vehicle Teleportation", vstring, "Teleport", "Cancel");
}