[Pedido] Sync
#1

Queria um comando que a pessoa digitasse /Sync ou /s e ele era sincronizado, tipo, ele era Spawnado e depois voltava pro mesmo lugar com as mesmas armas vida e colete

O /sync e pra desbugar o player й tambem pra descanзar a skin
Reply
#2

if(strcmp(cmd,"/respawn",true)==0)
{
if(PlayerInfo[playerid][pAdmin] < 5) return DenyMessage(playerid, 5);
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /respawn [playerid]");
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
SpawnPlayer(otherplayer);
SendClientMessage(otherplayer, COLOR_GREEN, "You were respawned by an Admin.");
return 1;
}

Voce so tem que inclementar isso ao sistema de admin ou voce pode tirar o codigo que pede admin para funcionar.
Reply
#3

pawn Код:
#include a_samp
#include zcmd

new Weap[12];
new Ammo[12];
new Float:Heal[MAX_PLAYERS], Float:Armour[MAX_PLAYERS];
new Float:OldPosition[MAX_PLAYERS][4];
new IntWorld[MAX_PLAYERS][2];
new bool:PlayerSync[MAX_PLAYERS char];

COMMAND:sync(playerid){
    GetPlayerHealth(playerid,Heal[playerid]);
    GetPlayerArmour(playerid,Armour[playerid]);
   
    GetPlayerPos(playerid,OldPosition[playerid][0],OldPosition[playerid][1],OldPosition[playerid][2]);
    GetPlayerFacingAngle(playerid,OldPosition[playerid][3]);
   
    IntWorld[playerid][0] = GetPlayerInterior(playerid);
    IntWorld[playerid][1] = GetPlayerVirtualWorld(playerid);
   
    for(new i=0;i<=12;i++){
        GetPlayerWeaponData(playerid,i,Weap[i],Ammo[i]);
    }
    SpawnPlayer(playerid);
   
    PlayerSync{playerid} = true;
    return 1;
}

COMMAND:s(playerid){
    return cmd_sync(playerid);
}

public OnPlayerSpawn(playerid){
    if(PlayerSync{playerid}){
        PlayerSync{playerid} = true;
       
        SetPlayerHealth(playerid,Heal[playerid]);
        SetPlayerArmour(playerid,Armour[playerid]);
       
        SetPlayerPos(playerid,OldPosition[playerid][0],OldPosition[playerid][1],OldPosition[playerid][2]);
        SetPlayerFacingAngle(playerid,OldPosition[playerid][3]);
       
        SetPlayerInterior(playerid,IntWorld[playerid][0]);
        SetPlayerVirtualWorld(playerid,IntWorld[playerid][1]);
       
        ResetPlayerWeapons(playerid);
       
        for(new i=0;i<=12;i++){
            GivePlayerWeapon(playerid,Weap[i],Ammo[i]);
        }
       
        SendClientMessage(playerid,0xFFFF00FF,"Vocк se a sincronizado com sucesso!");
        return 1;
    }
   
    return 1;
}
Reply
#4

Nгo deu apareceu que o comando n existe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)