Advertisement
ReshiramZekrom

Untitled

Oct 14th, 2023
2,167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.87 KB | None | 0 0
  1. #include <open.mp>
  2.  
  3.  
  4. #include <izcmd>
  5. #include <sscanf2>
  6.  
  7. main () {}
  8.  
  9. new skinid[MAX_PLAYERS];
  10.  
  11.  
  12. public OnGameModeInit() {
  13.  
  14.  
  15.  
  16.     return 1;
  17. }
  18.  
  19.  
  20. COMMAND:skin(playerid,params[])
  21. {
  22.     new skin1;
  23.     if(sscanf(params, "d", skin1)) return SendClientMessage(playerid, -1, "Use: /skin [id]");
  24.     if(skin1 < 0 || skin1 > 311) return SendClientMessage(playerid,-1,"invalid skin id");
  25.     SetPlayerSkin(playerid, skin1);
  26.     skinid[playerid] = skin1;
  27.  
  28.     SendClientMessage(playerid, -1, "skin set");
  29.     return 1;
  30. }
  31.  
  32.  
  33. COMMAND:sync(playerid,params[])
  34. {
  35.  
  36.     new Float:HP1, Float:HP2, Float:PosX,Float:PosY,Float:PosZ,Float:PosRZ, Int, VirtualWorld, CurrWep;
  37.     GetPlayerHealth(playerid, HP1);
  38.     GetPlayerArmour(playerid, HP2);
  39.  
  40.     CurrWep = WEAPON:GetPlayerWeapon(playerid);
  41.  
  42.     GetPlayerPos(playerid, PosX, PosY, PosZ);
  43.     GetPlayerFacingAngle(playerid, PosRZ);
  44.  
  45.     Int = GetPlayerInterior(playerid);
  46.     VirtualWorld = GetPlayerVirtualWorld(playerid);
  47.  
  48.  
  49.     new Weapons[13][2];
  50.     for(new i = 0; i < 13; i++) {
  51.         GetPlayerWeaponData(playerid, WEAPON_SLOT:i, WEAPON:Weapons[i][0], Weapons[i][1]);
  52.     }
  53.  
  54.     ClearAnimations(playerid);
  55.  
  56.     if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
  57.     SetPlayerPos(playerid, 0, 0, 0);
  58.     SpawnPlayer(playerid);
  59.  
  60.     SetPlayerSkin(playerid, skinid[playerid]);
  61.  
  62.     SetPlayerHealth(playerid, HP1);
  63.     SetPlayerArmour(playerid, HP2);
  64.  
  65.     SetPlayerPos(playerid, PosX, PosY, PosZ);
  66.  
  67.     SetPlayerFacingAngle(playerid,PosRZ);
  68.     SetCameraBehindPlayer(playerid);
  69.  
  70.     SetPlayerInterior(playerid, Int);
  71.     SetPlayerVirtualWorld(playerid, VirtualWorld);
  72.     ResetPlayerWeapons(playerid);
  73.     for(new i = 0; i < 13; i++) {
  74.         GivePlayerWeapon(playerid, WEAPON:Weapons[i][0], Weapons[i][1]);
  75.     }
  76.  
  77.     SetPlayerArmedWeapon(playerid, WEAPON:CurrWep);
  78.  
  79.     SendClientMessage(playerid, -1, "successfully synced");
  80.     return 1;
  81. }
  82.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement