[Ajuda]Coordenadas
#3

Tб ai o comando. USE: /pos x y z

pawn Код:
if(!strcmp(cmdtext, "/pos", true))
    {
      new idx;
        new tmp[256], Float:x, Float:y, z[256], Float:a;
        tmp = strtok(cmdtext, idx);
        x = floatstr(tmp);
        tmp = strtok(cmdtext, idx);
        y = floatstr(tmp);
        z = strtok(cmdtext, idx);
        a = floatstr(strtok(cmdtext, idx));
        if(!strlen(tmp))
            return SendClientMessage(playerid, 0xFFFFFFAA, "USE: /pos [x] [y] [z/'find'] ([a])");

        if(!strcmp(z, "find", true))
        {
            if(IsPlayerInAnyVehicle(playerid))
            {
                new vehicleid = GetPlayerVehicleID(playerid);
                new pseat = GetPlayerVehicleSeat(playerid);
                new Float:newz;
                for(new i; i < 3; i++)
                    SetPlayerPosFindZ(playerid, x, y, 20.0);
                GetPlayerPos(playerid, x, y, newz);
                SetVehiclePos(vehicleid, x, y, newz);
                SetVehicleZAngle(vehicleid, a);
                PutPlayerInVehicle(playerid, vehicleid, pseat);
                SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado com carro e findz.");
          } else {
                for(new i; i < 3; i++)
                    SetPlayerPosFindZ(playerid, x, y, 20.0);
                SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado a pй com findz.");
            }
        } else {
            if(IsPlayerInAnyVehicle(playerid))
            {
                SetVehiclePos(GetPlayerVehicleID(playerid), x, y, floatstr(z));
                SetVehicleZAngle(GetPlayerVehicleID(playerid), a);
                SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado com carro sem findz.");
            } else {
                SetPlayerPos(playerid, x, y, floatstr(z));
                SetPlayerFacingAngle(playerid, a);
                SendClientMessage(playerid, 0xFFFFFFAA, "Teleportado a pй sem findz.");
            }
        }
        SetCameraBehindPlayer(playerid);
        return 1;
    }
Reply


Messages In This Thread
[Ajuda]Coordenadas - by NathanLive - 24.04.2010, 22:16
Re: [Ajuda]Coordenadas - by tshadow - 24.04.2010, 22:18
Re: [Ajuda]Coordenadas - by Ambrуsio - 24.04.2010, 22:26
Re: [Ajuda]Coordenadas - by NathanLive - 24.04.2010, 23:47
Re: [Ajuda]Coordenadas - by SuB_ZeRo0_ - 24.04.2010, 23:53
Re: [Ajuda]Coordenadas - by BurrodaZero - 25.04.2010, 00:47

Forum Jump:


Users browsing this thread: 1 Guest(s)