SA-MP Forums Archive
[Ajuda] /ir Bugado com Veiculo - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] /ir Bugado com Veiculo (/showthread.php?tid=354810)



[Ajuda] /ir Bugado com Veiculo - Maklister - 28.06.2012

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;
}



Re: [Ajuda] /ir Bugado com Veiculo - .FuneraL. - 28.06.2012

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 (:


Re: [Ajuda] /ir Bugado com Veiculo - Victor' - 28.06.2012

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]);
}



Re: [Ajuda] /ir Bugado com Veiculo - Maklister - 28.06.2012

+REP

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