Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 17th, 2012  |  syntax: PAWN  |  size: 1.69 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #define GOTOGPLAYERCAR 19104 //At the top of the script.
  2.  
  3.         if(dialogid == GOTOGPLAYERCAR)//Under public OnDialogResponse
  4.         {
  5.                 if(response == 1)
  6.                 {
  7.                         for(new i = 0; i < MAX_GANG_VEHICLES; i++)
  8.                         {
  9.                                 if(listitem == i)
  10.                                 {
  11.                                         new Float: carPos[3], id = GetPVarInt(playerid, "gangaffectedcarTP");
  12.                                         if(FamilyVehicleInfo[id][i][fvId] != INVALID_PLAYER_VEHICLE_ID)
  13.                                         {
  14.                                                 GetVehiclePos(FamilyVehicleInfo[id][i][fvId], carPos[0], carPos[1], carPos[2]);
  15.                                                 SetPlayerVirtualWorld(playerid,GetVehicleVirtualWorld(FamilyVehicleInfo[id][i][fvId]));
  16.                                                 SetPlayerInterior(playerid,0);
  17.                                                 SetPlayerPos(playerid, carPos[0], carPos[1], carPos[2]);
  18.                                         }
  19.                                         else
  20.                                         {
  21.                                                 SendClientMessageEx(playerid, COLOR_WHITE, "You can not teleport to a empty/impounded slot.");
  22.                                         }
  23.                                 }
  24.                         }
  25.                 }
  26.         }
  27.  
  28.  
  29. CMD:ggotocar(playerid, params[]) //At CMD area, outside of all publics.
  30. {
  31.         new f;
  32.         if(sscanf(params,"d",f)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /ggotocar [Faction ID]");
  33.         new vstring[1024];
  34.         for(new i = 0; i < MAX_GANG_VEHICLES; i++)
  35.         {
  36.                 if(FamilyVehicleInfo[f][i][fvId] != INVALID_VEHICLE_ID)
  37.                 {
  38.                         format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[FamilyVehicleInfo[f][i][fvModelId] - 400]);
  39.                 }
  40.                 else if(FamilyVehicleInfo[f][i][fvImpounded] == 1) {
  41.                         format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[FamilyVehicleInfo[f][i][fvModelId] - 400]);
  42.                 }
  43.                 else
  44.                 {
  45.                         format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
  46.                 }
  47.         }
  48.         SetPVarInt(playerid, "gangaffectedcarTP", f);
  49.         return ShowPlayerDialog(playerid, GOTOGPLAYERCAR, DIALOG_STYLE_LIST, "Gang Vehicle Teleportation", vstring, "Teleport", "Cancel");
  50. }