[Pedido] /irh
#1

queria o comando de helper /irh que sу desse parar ir em uma pessoa de level 1 a 5
Reply
#2

nгo entendi a parte do level:
Код:
if(strcmp(cmd, "/ir", true) == 0 && LevelAdmin[playerid]>= 2)//coloque o level necessario pra poder usar o comando se for isso substitui 2 por outro level
{

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /ir (id do jogador)");
return 1;
}

giveplayerid = strval(tmp);
if(giveplayerid == playerid)
{
SendClientMessage(playerid, 0xFF9900AA, "Nгo й possivel usar sua propria id.");
return 1;
}

if(giveplayerid == LevelAdmin[playerid]>= 2)//caso seje isso, coloque no lugar de level 2 o level q o jogador precisa ter pra vc usar esse comando e funcionar pra ir nele
{
SendClientMessage(playerid, 0xFF9900AA, "Nгo й possivel usar sua propria id.");
return 1;
}

if(IsPlayerConnected(giveplayerid))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(giveplayerid, X, Y, Z);
new interior = GetPlayerInterior(giveplayerid);
SetPlayerInterior(playerid,interior);
//
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Vocк foi atй o jogador %s (id: %d).", giveplayer,giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
//
new VehicleID;
if(IsPlayerInAnyVehicle(playerid))
{
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, X, Y+4, Z);
}
else
{
SetPlayerPos(playerid,X, Y+2, Z);
}
}
else
{
format(string, sizeof(string), "ERRO: Nгo tem ninguem com a id(%d) online.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
acho q й isso q vc quer kkk qualquer coisa explica melhor ai
Reply
#3

Especifique, й player de level 1 hб 5?
Ou й admins de 1 hб 5?
Se for para admin, toma ae.

pawn Код:
if(strcmp(cmd, "/irh", true) == 0)
{

    if(IsPlayerConnected(playerid))
    {

        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {

            SendClientMessage(playerid, 0xBFC0C2FF, "USE: /irh [ id ]");
            return 1;
        }
        new Float:plocx,Float:plocy,Float:plocz;
        new plo;
        plo = ReturnUser(tmp);
        if (IsPlayerConnected(plo))
        {

            if(plo != INVALID_PLAYER_ID)
            {

                if (PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] <= 5)
                {

                    if(Spectate[playerid] != 255)
                    {

                        Spectate[playerid] = 256;
                    }
                    GetPlayerPos(plo, plocx, plocy, plocz);
                    if(PlayerInfo[plo][pInt] > 0)
                    {

                        SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                        PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
                        PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                    }
                    if(PlayerInfo[playerid][pInt] == 1)
                    {

                        SetPlayerInterior(playerid,0);
                    }
                    if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0)
                    {

                        SetPlayerInterior(playerid,1);
                        PlayerInfo[playerid][pInt] = 1;
                    }
                    if (GetPlayerState(playerid) == 2)
                    {

                        new tmpcar = GetPlayerVehicleID(playerid);
                        SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                        TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                    }
                    else
                    {

                        SetPlayerPos(playerid,plocx,plocy+2, plocz);
                    }
                    //
                }
                else
                {

                    SendClientMessage(playerid, 0xB4B5B7FF, "   Voce nгo esta autorizado a usar este comando!");
                }
            }
        }
        else
        {

            format(string, sizeof(string), "   %d nгo й um player ativo.", plo);
            SendClientMessage(playerid, 0xB4B5B7FF, string);
        }
    }
    return 1;
}
Reply
#4

Tipo, helper sу pode ir atй player de level 1 ha 5
Reply
#5

Quote:
Originally Posted by JowSmith
Посмотреть сообщение
Tipo, helper sу pode ir atй player de level 1 ha 5
Ok, ta ae.

PHP код:
if(strcmp(cmd"/irh"true) == 0)
{
    if(
IsPlayerConnected(playerid))
    {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playerid0xBFC0C2FF"USE: /irh [ id ]");
            return 
1;
        }
        new 
Float:plocx,Float:plocy,Float:plocz;
        new 
plo;
        
plo ReturnUser(tmp);
        if (
IsPlayerConnected(plo))
        {
            if(
plo != INVALID_PLAYER_ID)
            {
                if (
PlayerInfo[playerid][pHelper] >= && PlayerInfo[playerid][pHelper] <= 5)
                {
                    if(
Spectate[playerid] != 255)
                    {
                        
Spectate[playerid] = 256;
                    }
                    
GetPlayerPos(ploplocxplocyplocz);
                    if(
PlayerInfo[plo][pInt] > 0)
                    {
                        
SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                        
PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
                        
PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                    }
                    if(
PlayerInfo[playerid][pInt] == 1)
                    {
                        
SetPlayerInterior(playerid,0);
                    }
                    if(
plocz 530.0 && PlayerInfo[plo][pInt] == 0)
                    {
                        
SetPlayerInterior(playerid,1);
                        
PlayerInfo[playerid][pInt] = 1;
                    }
                    if (
GetPlayerState(playerid) == 2)
                    {
                        new 
tmpcar GetPlayerVehicleID(playerid);
                        
SetVehiclePos(tmpcarplocxplocy+4plocz);
                        
TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                    }
                    else
                    {
                        
SetPlayerPos(playerid,plocx,plocy+2plocz);
                    }
                    
//
                
}
                else
                {
                    
SendClientMessage(playerid0xB4B5B7FF"   Voce nгo esta autorizado a usar este comando!");
                }
            }
        }
        else
        {
            
format(stringsizeof(string), "   %d nгo й um player ativo."plo);
            
SendClientMessage(playerid0xB4B5B7FFstring);
        }
    }
    return 
1;

Reply
#6

Код:
if(strcmp(cmd, "/ir", true) == 0 && LevelAdmin[playerid]>= 2)//Se helper й por level, coloca no lugar de 2 o level do helper
{

tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Uso correto: /ir (id do jogador)");
return 1;
}

giveplayerid = strval(tmp);
if(giveplayerid == playerid)
{
SendClientMessage(playerid, 0xFF9900AA, "Nгo й possivel usar sua propria id.");
return 1;
}

if(giveplayerid == LevelAdmin[giveplayerid ]<= 5)//
{
SendClientMessage(playerid, 0xFF9900AA, "vocк nгo poder usar esse comando em players com level maior que 5");
return 1;
}

if(IsPlayerConnected(giveplayerid))
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(giveplayerid, X, Y, Z);
new interior = GetPlayerInterior(giveplayerid);
SetPlayerInterior(playerid,interior);
//
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "Vocк foi atй o jogador %s (id: %d).", giveplayer,giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
//
new VehicleID;
if(IsPlayerInAnyVehicle(playerid))
{
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, X, Y+4, Z);
}
else
{
SetPlayerPos(playerid,X, Y+2, Z);
}
}
else
{
format(string, sizeof(string), "ERRO: Nгo tem ninguem com a id(%d) online.", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
tinha mandado tudo errado kk tenta assim
Reply
#7

26 Erros :S
Reply
#8

manda os erros
Reply
#9

O Comando original й esse:
Код:
if(strcmp(cmd, "/irh", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /irh [id]");
				return true;
			}
			new Float:plocx,Float:plocy,Float:plocz;
			new plo, world;
			plo = ReturnUser(tmp);
			world = GetPlayerVirtualWorld(plo);
			if (IsPlayerConnected(plo))
			{
			    if(plo != INVALID_PLAYER_ID)
			    {
					if (PlayerInfo[playerid][pHelper] >= 1)
					{
					    if(helpertrampando[playerid] < 1 && PlayerInfo[playerid][pHelper] != 1)
						{
							SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo estб trabalhando ! (/helpajuda)");
							return true;
						}
						if(Spectate[playerid] != 255)
						{
							Spectate[playerid] = 256;
						}
						GetPlayerPos(plo, plocx, plocy, plocz);
						if(PlayerInfo[plo][pInt] > 0)
						{
							SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
							PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
							PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
						}
						if(PlayerInfo[plo][pInt] == 0)
						{
							SetPlayerInterior(playerid,0);
						}
						if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
						{
							SetPlayerInterior(playerid,1);
							PlayerInfo[playerid][pInt] = 1;
						}
						if (GetPlayerState(playerid) == 2)
						{
							new tmpcar = GetPlayerVehicleID(playerid);
							SetVehiclePos(tmpcar, plocx, plocy+4, plocz); LinkVehicleToInterior(tmpcar, 0);
							TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
						}
						else
						{
							XXAirBreak[playerid] += 3;SetPlayerPos(playerid,plocx,plocy+2, plocz);
						}
						SetPlayerVirtualWorld(playerid, world);
						SendClientMessage(playerid, 0x33FF00FF, "Vocк foi teleportado pelo Admin !");
						GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
						GetPlayerName(plo, plname, MAX_PLAYER_NAME);
						if(helpertrampando[playerid] == 1 && helperhide[playerid] == 1)
						{}
						else { format(string, sizeof(string), "Helper %s foi Atй %s.",playername,plname); }
						ProxDetector(30.0, playerid, string, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
						format(string, sizeof(string), "Helper %s veio Atй %s.",playername,plname);
						ProxDetector(30.0, plo, string, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Esse nгo й um player ativo.");
			}
		}
		return true;
	}
Reply
#10

alguem?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)