Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5.  
  6. new AdminVehicle[MAX_PLAYERS] = {INVALID_VEHICLE_ID, ...};
  7.  
  8. CMD:acar(playerid, params[])
  9. {
  10.     if(pInfo[playerid][pAdmin] >= 3)
  11.     {
  12.         CheckAdminVehicle(playerid);
  13.  
  14.         new Float:asdX, Float:asdY, Float:asdZ;
  15.         GetPlayerPos(playerid,asdX, asdY, asdZ);
  16.         AdminVehicle[playerid] = CreateVehicle(411, Float:asdX, Float:asdY, Float:asdZ, 0, 1, 1, 0);
  17.         PutPlayerInVehicle(playerid, AdminVehicle[playerid], 0);
  18.     }
  19.     return 1;
  20. }
  21.  
  22. public OnPlayerDisconnect(playerid, reason)
  23. {
  24.     CheckAdminVehicle(playerid); //Igen, még akkor is ellenőrizzük, ha nem admin. (Hogyha időközben elvették volna az adminját akkor is törli.)
  25.     return 1;
  26. }
  27.  
  28. public OnPlayerStateChange(playerid, newstate, oldstate)
  29. {
  30.     if(oldstate == PLAYER_STATE_DRIVER) CheckAdminVehicle(playerid);
  31.     return 1;
  32. }
  33.  
  34. stock CheckAdminVehicle(playerid) {
  35.     if(AdminVehicle[playerid] != INVALID_VEHICLE_ID) {
  36.         //Ha van neki adminjárműve..
  37.         AdminVehicle[playerid] = INVALID_VEHICLE_ID;
  38.         DestroyVehicle(AdminVehicle[playerid]);
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement