[AJUDA]: /ir e /trazer
#1

Olha eu aqui denovo '--' nesse meio to precisando de muita ajuda pra finalizar meu server e assim tentarei postar [FS] [GM] talvez [MAP] ok vamos ao que interessa
eu tenho 2 comandos de /ir e /trazer mas eu nao conseguindo fazer pra tipo quando usace o comando
Exemplo:"eu teleporto pra alguem ai aparece -> O Admin %s se teleportou para vocк" e pro admin aparece"Vocк atй o %s"
tentei fazer e saiu um fiasco

Код:
    dcmd_ir(playerid,params[])
    {
        if(PlayerData[playerid][AdminLevel] >= 1)
        {
        new idx,tmpit[256];
        tmpit = strtok(params,idx);
        if(!strlen(tmpit))
        {
            SendClientMessage(playerid,COLOR_GREY,"Use: /ir [playerid]");
            return true;
        }
        new pid = strval(tmpit);
        if(!IsPlayerConnected(pid))
        {
            SendClientMessage(playerid,COLOR_GREY,"ID Invбlido");
            return true;
        }
        new Float:playerpos[4],pint;
        GetPlayerPos(pid,playerpos[0],playerpos[1],playerpos[2]);
        GetPlayerFacingAngle(pid,playerpos[3]);
        pint = GetPlayerInterior(pid);
        if(playerpos[3] > 180.0)
        {
            playerpos[3]-=180.0;
        }
        else
        {
            playerpos[3]+=180.0;
        }
        GetXYBehindPlayer(pid,playerpos[0],playerpos[1],3.0);
        SetPlayerPos(playerid,playerpos[0],playerpos[1],playerpos[2]);
        SetPlayerFacingAngle(playerid,playerpos[3]);
        SetPlayerFacingAngle(playerid,playerpos[3]);
        SetPlayerInterior(playerid,pint);
        return true;
        }
        else return SendClientMessage(playerid,COLOR_RED, "[INFO]: Vocк nгo й ADM");
    }

    dcmd_trazer(playerid,params[])
    {
        if(PlayerData[playerid][AdminLevel] >= 3)
        {
        new idx,tmpit[256];
        tmpit = strtok(params,idx);

        if(!strlen(tmpit))
        {
            SendClientMessage(playerid,COLOR_GREY,"Use: /trazer [playerid]");
            return true;
        }
        new pid = strval(tmpit);

        if(!IsPlayerConnected(pid))
        {
            SendClientMessage(playerid,COLOR_GREY,"ID INvбlido");
            return true;
        }
        new Float:playerpos[4],pint;
        GetPlayerPos(playerid,playerpos[0],playerpos[1],playerpos[2]);
        GetPlayerFacingAngle(playerid,playerpos[3]);
        pint = GetPlayerInterior(playerid);
        SendClientMessage(playerid,COLOR_WHITE,"O Admin trouxe vocк atй ele");
        if(playerpos[3] > 180.0)
        {
            playerpos[3]-=180.0;
        }
        else
        {
            playerpos[3]+=180.0;
        }
        GetXYInFrontOfPlayer(playerid,playerpos[0],playerpos[1],3.0);
        SetPlayerPos(pid,playerpos[0],playerpos[1],playerpos[2]);
        SetPlayerFacingAngle(pid,playerpos[3]);
        SetPlayerInterior(pid,pint);
        SendClientMessage(playerid,COLOR_WHITE,"Vocк trouxe o jogador atй vocк");
        return true;
        }
        else return SendClientMessage(playerid,COLOR_RED, "[INFO]: Vocк nгo й ADM");
    }
Reply
#2

Use giveplayerid + playerid
Reply
#3

Use tmb format
Reply
#4

pawn Код:
dcmd_ir(playerid,params[])
    {
        if(PlayerData[playerid][AdminLevel] >= 1)
        {
        new name[24], admin[24], string[128], str[128];
        new idx,tmpit[256];
        tmpit = strtok(params,idx);
        if(!strlen(tmpit))
        {
            SendClientMessage(playerid,COLOR_GREY,"Use: /ir [playerid]");
            return true;
        }
        new pid = strval(tmpit);
        if(!IsPlayerConnected(pid))
        {
            SendClientMessage(playerid,COLOR_GREY,"ID Invбlido");
            return true;
        }
        new Float:playerpos[4],pint;
        GetPlayerPos(pid,playerpos[0],playerpos[1],playerpos[2]);
        GetPlayerFacingAngle(pid,playerpos[3]);
        pint = GetPlayerInterior(pid);
        if(playerpos[3] > 180.0)
        {
            playerpos[3]-=180.0;
        }
        else
        {
            playerpos[3]+=180.0;
        }
        GetXYBehindPlayer(pid,playerpos[0],playerpos[1],3.0);
        SetPlayerPos(playerid,playerpos[0],playerpos[1],playerpos[2]);
        SetPlayerFacingAngle(playerid,playerpos[3]);
        SetPlayerFacingAngle(playerid,playerpos[3]);
        SetPlayerInterior(playerid,pint);
        GetPlayerName(playerid, admin, sizeof(admin));
        GetPlayerName(pid, name, sizeof(name));
        format(string, sizeof(string),"Voce foi atй o Player %s", name);
        format(str, sizeof(str),"O Admin %s foi atй Voce!", admin);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(pid, -1, str);
        return true;
        }
        else return SendClientMessage(playerid,COLOR_RED, "[INFO]: Vocк nгo й ADM");
    }

    dcmd_trazer(playerid,params[])
    {
        new name[24], admin[24], string[128], str[128];
        if(PlayerData[playerid][AdminLevel] >= 3)
        {
        new idx,tmpit[256];
        tmpit = strtok(params,idx);

        if(!strlen(tmpit))
        {
            SendClientMessage(playerid,COLOR_GREY,"Use: /trazer [playerid]");
            return true;
        }
        new pid = strval(tmpit);

        if(!IsPlayerConnected(pid))
        {
            SendClientMessage(playerid,COLOR_GREY,"ID INvбlido");
            return true;
        }
        new Float:playerpos[4],pint;
        GetPlayerPos(playerid,playerpos[0],playerpos[1],playerpos[2]);
        GetPlayerFacingAngle(playerid,playerpos[3]);
        pint = GetPlayerInterior(playerid);
        format(string, sizeof(string),"Voce puxou o Player %s", name);
        format(str, sizeof(str),"O Admin %s te puxou atй ele!", admin);
        SendClientMessage(playerid, -1, string);
        SendClientMessage(pid, -1, str);
        if(playerpos[3] > 180.0)
        {
            playerpos[3]-=180.0;
        }
        else
        {
            playerpos[3]+=180.0;
        }
        GetXYInFrontOfPlayer(playerid,playerpos[0],playerpos[1],3.0);
        SetPlayerPos(pid,playerpos[0],playerpos[1],playerpos[2]);
        SetPlayerFacingAngle(pid,playerpos[3]);
        SetPlayerInterior(pid,pint);
        SendClientMessage(playerid,COLOR_WHITE,"Vocк trouxe o jogador atй vocк");
        return true;
        }
        else return SendClientMessage(playerid,COLOR_RED, "[INFO]: Vocк nгo й ADM");
Se der erro me avisa!
Reply
#5

blacktrindade
Muito obrigao ta funcionando perfeito vlw
+resp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)