Command Help
#1

I have a little problem , i want to do a log for my server at /goto but when I type /goto NAME appear
IMAGE

How can I make to appear NAME has teleported to NAME
The code is
pawn Код:
format(string, sizeof(string), "[ADMIN]: %s Has Teleported to %s", sendername, giveplayer);
What is wrong?

All code is
pawn Код:
if(strcmp(cmd, "/goto", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /goto [playerid/PartOfName]");
                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][pModerator] >= 1)
                    {
                        GetPlayerPos(plo, plocx, plocy, plocz);
                        if(PlayerInfo[plo][pInt] > 0)
                        {
                            SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
                            PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
                        }
                        else
                        {
                            SetPlayerInterior(playerid,0);
                        }
                        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);
                        }
                        SetPlayerVirtualWorld(playerid, PlayerInfo[plo][pVirWorld]);
                        GetPlayerName(plo, giveplayer, sizeof(giveplayer));
                        format(string, sizeof(string), "[ADMIN]: %s Has Teleported to %s", sendername, giveplayer);
                        ABroadCast(COLOR_LIGHTRED, string, 5);
                        new y, m, d;
                        new h,mi,s;
                        getdate(y,m,d);
                        gettime(h,mi,s);
                        format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s has Teleported Himself to %s",d,m,y,h,mi,s,sendername,giveplayer);
                    //  TelesLog(string);
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_GRAD1, "** You are not authorized to use that command!");
                        return 1;
                    }
                }
            }
            else
            {
                format(string, sizeof(string), "   %d is not an active player.", plo);
                SendClientMessage(playerid, COLOR_GRAD1, string);
                return 1;
            }
        }
        return 1;
    }
I know it's // at TelesLog .. i don't want to remove it before I fix this..
Reply
#2

pawn Код:
GetPlayerName(playerid, sendername, sizeof(sendername));
Reply
#3

Oh , thank you , I will test it right now If works +rep


Works! Thank you +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)