Ditti4

/vspawn

Nov 18th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.33 KB | None | 0 0
  1. COMMAND:vspawn(playerid, params[])
  2. {
  3.     if(GetPVarInt(playerid, "adminscore") >= 1)
  4.     {
  5.         new vid, Float:x, Float:y, Float:z, Float:ang, car, string[128];
  6.        
  7.         if (!sscanf(params, "k<vehicle>", vid))
  8.         {
  9.             if (vid)
  10.             {
  11.                 if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
  12.                 {
  13.                     GetVehicleZAngle(GetPlayerVehicleID(playerid), ang);
  14.                     DestroyVehicle(GetPlayerVehicleID(playerid));
  15.                 }
  16.                 else if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  17.                 {
  18.                     if (GetPVarInt(playerid, "lastvehicle"))
  19.                     {
  20.                         DestroyVehicle(GetPVarInt(playerid, "lastvehicle"));
  21.                     }
  22.                 }
  23.                 GetPlayerPos(playerid, x, y, z);
  24.                 GetPlayerFacingAngle(playerid, ang);
  25.                
  26.                 car = AddStaticVehicle(vid, x, y, z, ang, 183, 183);
  27.                
  28.                 SetVehicleNumberPlate(car, "Admin");
  29.                 SetVehicleHealth(car, 100000000);
  30.                
  31.                 PutPlayerInVehicle(playerid, car, 0);
  32.                 Create3DTextLabel(string, COLOR_RED, 0.0, 0.0, 0.0, 50.0, 0, 1 );
  33.             }
  34.         }
  35.         else
  36.         {
  37.             SendClientMessage(playerid, COLOR_BLUE, "/vspawn [Model-ID/-Name]");
  38.         }
  39.     }
  40.     else
  41.     {
  42.         new string[128];
  43.        
  44.         format(string, sizeof(string), "Türsteher: %s wurde gekickt. - Grund: /vspawn ist nur für Mods und Admins!", GetName(playerid));
  45.         SendClientMessageToAll(COLOR_RED, string);
  46.         Kick(playerid);
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment