[Ajuda] Melhorar Comando /sinc
#1

galera eu fiz um comando /sinc que o player digita e й sicroninzado
Код:
//---------------- Sincronizar ----------------------------
if(strcmp(cmdtext, "/sinc", true) == 0 || strcmp(cmdtext, "/sincronizar", true) == 0)
{
if(GetPlayerState(playerid) == 9|| GetPlayerState(playerid) == 5 || GetPlayerState(playerid) == 6 ||GetPlayerState(playerid) == 4|| GetPlayerState(playerid) == 0 || sincronizando[playerid] == 1)
{
	SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode sincronizar agora!");
	return 1;
}
 	sincronizando[playerid] = 1;
 	virt[playerid] = GetPlayerVirtualWorld(playerid);
	interior[playerid] = GetPlayerInterior(playerid);
	skinneg[playerid] = GetPlayerSkin(playerid);
	GetPlayerArmour(playerid,APP[playerid]);
	GetPlayerHealth(playerid,PlayerHPP[playerid]);
	GetPlayerFacingAngle(playerid,FaceAngle[playerid]);
	GetPlayerPos(playerid,xx[playerid],yy[playerid],zz[playerid]);
	GetPlayerWeaponData(playerid,1,gunsinc[1][playerid],ammoo[1][playerid]);
	GetPlayerWeaponData(playerid,2,gunsinc[2][playerid],ammoo[2][playerid]);
	GetPlayerWeaponData(playerid,3,gunsinc[3][playerid],ammoo[3][playerid]);
	GetPlayerWeaponData(playerid,4,gunsinc[4][playerid],ammoo[4][playerid]);
	GetPlayerWeaponData(playerid,5,gunsinc[5][playerid],ammoo[5][playerid]);
	GetPlayerWeaponData(playerid,6,gunsinc[6][playerid],ammoo[6][playerid]);
	GetPlayerWeaponData(playerid,7,gunsinc[7][playerid],ammoo[7][playerid]);
	GetPlayerWeaponData(playerid,8,gunsinc[8][playerid],ammoo[8][playerid]);
	GetPlayerWeaponData(playerid,9,gunsinc[9][playerid],ammoo[9][playerid]);
	GetPlayerWeaponData(playerid,10,gunsinc[10][playerid],ammoo[10][playerid]);
	GetPlayerWeaponData(playerid,11,gunsinc[11][playerid],ammoo[11][playerid]);
	GetPlayerWeaponData(playerid,12,gunsinc[12][playerid],ammoo[12][playerid]);
	if(IsPlayerInAnyVehicle(playerid))
	{
	vehicledd[playerid] = 1;
	VehicleIDD[playerid] = GetPlayerVehicleID(playerid);
	}
	SpawnPlayer(playerid);
	TempoSinc = SetTimerEx("Sincronizar", 500, 0, "i", playerid);
	return 1;
}
so que eu queria transformar em um comando que o adm dece no player, nao o player dece sozinho, alguem pode me ajuda ai?
Reply
#2

Como este cуdigo foi copiado do Thug, entгo suponho que seu sistema de parвmetros seja strtok

Fiz pra vocк, isto deve resolver o seu problema

pawn Код:
if(strcmp(cmd, "/sinc", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] > 0)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /sinc [id]");
                return 1;
            }
            if(GetPlayerState(strval(tmp)) == 9|| GetPlayerState(strval(tmp)) == 5 || GetPlayerState(strval(tmp)) == 6 ||GetPlayerState(strval(tmp)) == 4|| GetPlayerState(strval(tmp)) == 0 || sincronizando[strval(tmp)] == 1)
            {
                SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode sincronizб-lo agora!");
                return 1;
            }
            sincronizando[strval(tmp)] = 1;
            virt[strval(tmp)] = GetPlayerVirtualWorld(strval(tmp));
            interior[strval(tmp)] = GetPlayerInterior(strval(tmp));
            skinneg[strval(tmp)] = GetPlayerSkin(strval(tmp));
            GetPlayerArmour(strval(tmp),APP[strval(tmp)]);
            GetPlayerHealth(strval(tmp),PlayerHPP[strval(tmp)]);
            GetPlayerFacingAngle(strval(tmp),FaceAngle[strval(tmp)]);
            GetPlayerPos(strval(tmp),xx[strval(tmp)],yy[strval(tmp)],zz[strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),1,gunsinc[1][strval(tmp)],ammoo[1][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),2,gunsinc[2][strval(tmp)],ammoo[2][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),3,gunsinc[3][strval(tmp)],ammoo[3][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),4,gunsinc[4][strval(tmp)],ammoo[4][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),5,gunsinc[5][strval(tmp)],ammoo[5][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),6,gunsinc[6][strval(tmp)],ammoo[6][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),7,gunsinc[7][strval(tmp)],ammoo[7][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),8,gunsinc[8][strval(tmp)],ammoo[8][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),9,gunsinc[9][strval(tmp)],ammoo[9][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),10,gunsinc[10][strval(tmp)],ammoo[10][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),11,gunsinc[11][strval(tmp)],ammoo[11][strval(tmp)]);
            GetPlayerWeaponData(strval(tmp),12,gunsinc[12][strval(tmp)],ammoo[12][strval(tmp)]);
            if(IsPlayerInAnyVehicle(strval(tmp)))
            {
                vehicledd[strval(tmp)] = 1;
                VehicleIDD[strval(tmp)] = GetPlayerVehicleID(strval(tmp));
            }
            SpawnPlayer(strval(tmp));
            TempoSinc = SetTimerEx("Sincronizar", 500, 0, "i", strval(tmp));
        }
        return 1;
    }

Espero ter ajudado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)