Help, Whats wrong with this?
#1

Whats wrong with this command? its supposed to send "giveplayer" to LS if someone else does /sendtols [id]


pawn Код:
if(strcmp(cmd, "/sendtols", true) == 9)
    {
        new tmp[30];
        // assign the id (written by the user) to tmp
        tmp = strtok(cmdtext, idx);

        // convert the id to an integer using strval (this is essential)
        // and assign to otherplayer
        new giveplayer = strval(tmp);

            if(PlayerInfo[playerid][pAdmin] >= 2)
            {

                if (GetPlayerState(playerid) == 2)
                {
                    new tmpcar = GetPlayerVehicleID(giveplayer);
                    SetVehiclePos(tmpcar, 1529.6,-1691.2,13.3);
                    TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
                    LinkVehicleToInterior(tmpcar, 0);
                    SetPlayerVirtualWorld(giveplayer, 0);
                    OnPlayerExitFood(giveplayer);
                    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 Teleported %s to Los Santos",d,m,y,h,mi,s,sendername,giveplayer);
                    TelesLog(string);
                }
                else
                {
                    SafeSetPlayerPos(giveplayer, 1529.6,-1691.2,13.3);
                    SetPlayerVirtualWorld(giveplayer, 0);
                }
                format(string, sizeof(string), "[ADMIN]: %s Has Teleported %s to Los Santos.", sendername,giveplayer);
                ABroadCast(COLOR_LIGHTRED,string, 5);
                SafeSetPlayerInterior(playerid,0);
                DisablePlayerCheckpoint(playerid);
                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 Teleported %s to Los Santos",d,m,y,h,mi,s,sendername,giveplayer);
                TelesLog(string);
            }
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)