Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <open.mp>
- #include <izcmd>
- #include <sscanf2>
- main () {}
- new skinid[MAX_PLAYERS];
- public OnGameModeInit() {
- return 1;
- }
- COMMAND:skin(playerid,params[])
- {
- new skin1;
- if(sscanf(params, "d", skin1)) return SendClientMessage(playerid, -1, "Use: /skin [id]");
- if(skin1 < 0 || skin1 > 311) return SendClientMessage(playerid,-1,"invalid skin id");
- SetPlayerSkin(playerid, skin1);
- skinid[playerid] = skin1;
- SendClientMessage(playerid, -1, "skin set");
- return 1;
- }
- COMMAND:sync(playerid,params[])
- {
- new Float:HP1, Float:HP2, Float:PosX,Float:PosY,Float:PosZ,Float:PosRZ, Int, VirtualWorld, CurrWep;
- GetPlayerHealth(playerid, HP1);
- GetPlayerArmour(playerid, HP2);
- CurrWep = WEAPON:GetPlayerWeapon(playerid);
- GetPlayerPos(playerid, PosX, PosY, PosZ);
- GetPlayerFacingAngle(playerid, PosRZ);
- Int = GetPlayerInterior(playerid);
- VirtualWorld = GetPlayerVirtualWorld(playerid);
- new Weapons[13][2];
- for(new i = 0; i < 13; i++) {
- GetPlayerWeaponData(playerid, WEAPON_SLOT:i, WEAPON:Weapons[i][0], Weapons[i][1]);
- }
- ClearAnimations(playerid);
- if(IsPlayerInAnyVehicle(playerid)) RemovePlayerFromVehicle(playerid);
- SetPlayerPos(playerid, 0, 0, 0);
- SpawnPlayer(playerid);
- SetPlayerSkin(playerid, skinid[playerid]);
- SetPlayerHealth(playerid, HP1);
- SetPlayerArmour(playerid, HP2);
- SetPlayerPos(playerid, PosX, PosY, PosZ);
- SetPlayerFacingAngle(playerid,PosRZ);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid, Int);
- SetPlayerVirtualWorld(playerid, VirtualWorld);
- ResetPlayerWeapons(playerid);
- for(new i = 0; i < 13; i++) {
- GivePlayerWeapon(playerid, WEAPON:Weapons[i][0], Weapons[i][1]);
- }
- SetPlayerArmedWeapon(playerid, WEAPON:CurrWep);
- SendClientMessage(playerid, -1, "successfully synced");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement