[Ajuda] /ir Bugado com Veiculo
#1

Ajuda,

Eae Galerinha, Tou aqui mais uma vez ..

Minha questao agora й assim, Quando dou /ir sem estar em algum Veiculo vou normalmente, mas quando dou /ir dentro de um veiculo, Vou parar la no centro do mapa ...

pawn Код:
CMD:ir(playerid, params[])
{
    new giverid, Float:pos[3], stringtext[150];
    if(PlayerInfo[playerid][pAdmin] < 1000) return SendClientMessage(playerid, VERMELHO_ESCURO, "Vocк nгo tem autorizaзгo!");
    if(sscanf(params, "u", giverid)) return SendClientMessage(playerid, VERMELHO_ESCURO, "[x] Uso /ir [id]");
    if(giverid == INVALID_PLAYER_ID) return SendClientMessage(playerid, VERMELHO_ESCURO, "ID invalido.");
    if(!IsPlayerConnected(giverid)) return SendClientMessage(playerid, VERMELHO_ESCURO, "Usuario nгo conectado.");
    new Float: X,Float: Y,Float: Z;
    GetPlayerPos(giverid, pos[0], pos[1], pos[2]);
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    {
        new VehicleID;
        VehicleID = GetPlayerVehicleID(playerid);
        SetVehiclePos(VehicleID, X + 1, Y + 1, Z);
        PutPlayerInVehicle(playerid, VehicleID, 0);
    }
    if(PlayerInfo[playerid][pAdmin] == 2000)
    {
        GetPlayerName(playerid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] O(A) administrador(a) %s foi atй a sua localizaзгo para te ajudar!", pNome);
        SendClientMessage(giverid, VERDE_CLARO_1, stringtext);
        GetPlayerName(giverid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] Vocк foi ate a localizaзгo do jogador %s para ajuda-lo!",pNome);
        SendClientMessage(playerid, VERDE_CLARO_1, stringtext);
    }
    if(PlayerInfo[playerid][pAdmin] == 1000)
    {
        GetPlayerName(playerid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] O(A) moderador(a) %s foi atй a sua localizaзгo para te ajudar!", pNome);
        SendClientMessage(giverid, VERDE_CLARO_1, stringtext);
        GetPlayerName(giverid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] Vocк foi ate a localizaзгo do jogador %s para ajuda-lo!",pNome);
        SendClientMessage(playerid, VERDE_CLARO_1, stringtext);
    }
    return 1;
}
Reply
#2

pawn Код:
CMD:ir(playerid, params[])
{
    new giverid, Float:pos[3], stringtext[150];
    if(PlayerInfo[playerid][pAdmin] < 1000) return SendClientMessage(playerid, VERMELHO_ESCURO, "Vocк nгo tem autorizaзгo!");
    if(sscanf(params, "u", giverid)) return SendClientMessage(playerid, VERMELHO_ESCURO, "[x] Uso /ir [id]");
    if(giverid == INVALID_PLAYER_ID) return SendClientMessage(playerid, VERMELHO_ESCURO, "ID invalido.");
    if(!IsPlayerConnected(giverid)) return SendClientMessage(playerid, VERMELHO_ESCURO, "Usuario nгo conectado.");
    new Float: X,Float: Y,Float: Z;
    GetPlayerPos(giverid, pos[0], pos[1], pos[2]);
    SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    new VehicleID, Float:xx, Float:xy, Float:xz;
    VehicleID = GetPlayerVehicleID(playerid);
    GetPlayerPos(giverid, xx, xy, xz);
    SetVehiclePos(VehicleID, xx, xy, xz+1);
    PutPlayerInVehicle(playerid, VehicleID, 0);
    if(PlayerInfo[playerid][pAdmin] == 2000)
    {
        GetPlayerName(playerid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] O(A) administrador(a) %s foi atй a sua localizaзгo para te ajudar!", pNome);
        SendClientMessage(giverid, VERDE_CLARO_1, stringtext);
        GetPlayerName(giverid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] Vocк foi ate a localizaзгo do jogador %s para ajuda-lo!",pNome);
        SendClientMessage(playerid, VERDE_CLARO_1, stringtext);
    }
    if(PlayerInfo[playerid][pAdmin] == 1000)
    {
        GetPlayerName(playerid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] O(A) moderador(a) %s foi atй a sua localizaзгo para te ajudar!", pNome);
        SendClientMessage(giverid, VERDE_CLARO_1, stringtext);
        GetPlayerName(giverid, pNome, sizeof(pNome));
        format(stringtext, sizeof(stringtext), "[BCV Admin] Vocк foi ate a localizaзгo do jogador %s para ajuda-lo!",pNome);
        SendClientMessage(playerid, VERDE_CLARO_1, stringtext);
    }
    return 1;
}
Tente (:
Reply
#3

Troque isto:
pawn Код:
SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
{
    new VehicleID;
    VehicleID = GetPlayerVehicleID(playerid);
    SetVehiclePos(VehicleID, X + 1, Y + 1, Z);
    PutPlayerInVehicle(playerid, VehicleID, 0);
}
por isto:

pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
{
    static VehicleID;
    VehicleID = GetPlayerVehicleID(playerid);
    SetVehiclePos(VehicleID, pos[0]+1.0, pos[1]+1.0, pos[2]);
}
Reply
#4

+REP

Os Dois ai Deu Certo vlw Gente jaja volto com mais Duvidas xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)