SA-MP Forums Archive
[Ajuda] Liberar comando pra VIPS - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Liberar comando pra VIPS (/showthread.php?tid=498888)



Liberar comando pra VIPS - LucasTop - 05.03.2014

Alguйm me ajuda como posso liberar esse comando pros players VIPS?

PHP код:
if(strcmp(cmd, "/ir", true) == 0) {
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(
pAdmin[playerid] > 0   || dini_Int(file, "Profissao") == Guardiao){
new 
tmp[256];
new 
plid;
tmp = strtok(cmdtext, idx);
if(!
strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "[ERRO] Digite: /ir [id]");
return 
1;
}
plid = strval(tmp);
if(
IsPlayerConnected(plid)){
new 
interiordele;
interiordele = GetPlayerInterior(plid);
SetPlayerInterior(playerid, interiordele);
new 
Float:X, Float:Y, Float:Z;
GetPlayerPos(plid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
{
new 
VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID,X+1,Y+1,Z);
PutPlayerInVehicle(playerid,VehicleID,0);
}
new 
pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[NH] O Administrador %s (%d) foi atй sua posiзгo para ajuda-lo!", aname,playerid);
SendClientMessage(plid,tcadm, string);
return 
1;
}else{
SendClientMessage(playerid, Vermelho, "[ERRO]ID invбlido");
return 
1;
}
}
} 



Re: Liberar comando pra VIPS - Adejair - 05.03.2014

Basta Voce Colocar a Variavel dos Players VIP

pawn Код:
if(pAdmin[playerid] > 0   || dini_Int(file, "Profissao") == Guardiao){
// Exemplo
if(pVip[playerid] >=1 || if(pAdmin[playerid] >0 || dini_Int(file,"Profissao") == Guardiao){



Re: Liberar comando pra VIPS - LucasTadeu - 05.03.2014

PHP код:
if(strcmp(cmd, "/ir", true) == 0) {
new 
aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(
vip[playerid] == 1 || pAdmin[playerid] > 0   || dini_Int(file, "Profissao") == Guardiao){
new 
tmp[256];
new 
plid;
tmp = strtok(cmdtext, idx);
if(!
strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "[ERRO] Digite: /ir [id]");
return 
1;
}
plid = strval(tmp);
if(
IsPlayerConnected(plid)){
new 
interiordele;
interiordele = GetPlayerInterior(plid);
SetPlayerInterior(playerid, interiordele);
new 
Float:X, Float:Y, Float:Z;
GetPlayerPos(plid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
{
new 
VehicleID;
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID,X+1,Y+1,Z);
PutPlayerInVehicle(playerid,VehicleID,0);
}
new 
pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "[NH] O Administrador %s (%d) foi atй sua posiзгo para ajuda-lo!", aname,playerid);
SendClientMessage(plid,tcadm, string);
return 
1;
}else{
SendClientMessage(playerid, Vermelho, "[ERRO]ID invбlido");
return 
1;
}
}
} 



Re: Liberar comando pra VIPS - yNexus - 05.03.2014

PHP код:
if(strcmp(cmd, "/ir", true) == 0)
{
    new 
aname[MAX_PLAYER_NAME];
    
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    
format(file, sizeof(file), PASTA_CONTAS, aname);
    if(
PlayerInfo[playerid][pVip] >= 1 || pAdmin[playerid] > 0 || dini_Int(file, "Profissao") == Guardiao)
    {
        new 
tmp[256];
        new 
plid;
        
tmp = strtok(cmdtext, idx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid, Vermelho, "[ERRO] Digite: /ir [id]");
            return 
1;
        }
        
plid = strval(tmp);
        if(
IsPlayerConnected(plid))
        {
            new 
interiordele;
            
interiordele = GetPlayerInterior(plid);
            
SetPlayerInterior(playerid, interiordele);
            new 
Float:X, Float:Y, Float:Z;
            
GetPlayerPos(plid, X, Y, Z);
            
SetPlayerPos(playerid, X, Y, Z);
            {
                new 
VehicleID;
                
VehicleID = GetPlayerVehicleID(playerid);
                
SetVehiclePos(VehicleID,X+1,Y+1,Z);
                
PutPlayerInVehicle(playerid,VehicleID,0);
            }
            new 
pname[MAX_PLAYER_NAME];
            
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
            
format(string, sizeof(string), "[NH] O Administrador %s (%d) foi atй sua posiзгo para ajuda-lo!", aname,playerid);
            
SendClientMessage(plid,tcadm, string);
            return 
1;
        }
        else
        {
            
SendClientMessage(playerid, Vermelho, "[ERRO]ID invбlido");
            return 
1;
        }
    }
} 



Re: Liberar comando pra VIPS - LucasTop - 05.03.2014

Valeu galera!