Advertisement
Splav

Untitled

Jun 11th, 2012
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.51 KB | None | 0 0
  1. public OnPlayerDisconnect(playerid, reason)
  2. {
  3.     if(IsValidDynamicObject(GetPVarInt(playerid, "PlObjAtToVeh"))
  4.         DestroyDynamicObject(GetPVarInt(playerid, "PlObjAtToVeh"));
  5.     return 1;
  6. }
  7.  
  8. if(!strcmp(cmd, "/vob", true))
  9.     {
  10.         if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, 0xAFAFAFAA, "Вам недоступно");
  11.  
  12.         new vID, obID, offsets[3], rots[3];
  13.         if(sscanf(params, "ddffffff", vID, obID, offsets[0], offsets[1], offsets[2], rots[0], rots[1], rots[2])) return SendClientMessage(playerid, 0xAFAFAFAA, "Используйте: /vob [ID машины][ID объекта][offset X][offset Y][offset Z][rot X][rot Y][rot Z]");
  14.  
  15.         if(IsValidDynamicObject(GetPVarInt(playerid, "PlObjAtToVeh")))
  16.         {
  17.             DestroyDynamicObject(GetPVarInt(playerid, "PlObjAtToVeh"));
  18.             SetPVarInt(playerid, "PlObjAtToVeh", 0);
  19.         }
  20.        
  21.         SetPVarInt(playerid, "PlObjAtToVeh", CreateDynamicObject(obID, offsets[0], offsets[1], offsets[2], rots[0], rots[1], rots[2]));
  22.         AttachDynamicObjectToVehicle(GetPVarInt(playerid, "PlObjAtToVeh"), vID, offsets[0], offsets[1], offsets[2], rots[0], rots[1], rots[2]);
  23.        
  24.         return 1;
  25.     }
  26.    
  27.     if(!strcmp(cmd, "/delvob", true))
  28.     {
  29.         if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, 0xAFAFAFAA, "Вам недоступно");
  30.  
  31.         if(IsValidDynamicObject(GetPVarInt(playerid, "PlObjAtToVeh")))
  32.         {
  33.             DestroyDynamicObject(GetPVarInt(playerid, "PlObjAtToVeh"));
  34.             SetPVarInt(playerid, "PlObjAtToVeh", 0);
  35.         }
  36.         return 1;
  37.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement