[Ajuda]Nгo ejeta do carro
#1

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(Nitro(vehicleid))
    {
AddVehicleComponent(vehicleid, 1010);
}
if((vehicleid >= GroveCars[0]) && (vehicleid <= GroveCars[2]))
    {
        if(gTeam[playerid] == Grove)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, -1, "Vo");
        }
    }
return 1;
}
Nгo ejeta do carro tipow mafioso
Reply
#2

Quote:
Originally Posted by goku114
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(Nitro(vehicleid))
    {
AddVehicleComponent(vehicleid, 1010);
}
if((vehicleid >= GroveCars[0]) && (vehicleid <= GroveCars[2]))
    {
        if(gTeam[playerid] == Grove) // Apenas troque isto para as Outras Gangs ^^
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, -1, "Vo");
        }
    }
return 1;
}
Nгo ejeta do carro tipow mafioso
Coloquei jб a explicaзгo no Code.
Reply
#3

manda o code desse GroveCars
Reply
#4

pawn Код:
GroveCars[0] = AddStaticVehicleEx(498,1245.00000000,-2038.00000000,60.09999847,0.00000000,93,93,600); //Boxville
    GroveCars[1] = AddStaticVehicleEx(498,1276.30004883,-2038.00000000,60.00000000,0.00000000,93,93,600); //Boxville
    GroveCars[2] = AddStaticVehicleEx(411,1276.19995117,-2010.50000000,58.79999924,178.00000000,93,1,600); //Infernus
seria isso?

ou

Quote:

new GroveCars[3];

Reply
#5

pawn Код:
new GroveCars[4];

GroveCars[0] = AddStaticVehicleEx(498,1245.00000000,-2038.00000000,60.09999847,0.00000000,93,93,600); //Boxville
    GroveCars[1] = AddStaticVehicleEx(498,1276.30004883,-2038.00000000,60.00000000,0.00000000,93,93,600); //Boxville
    GroveCars[2] = AddStaticVehicleEx(411,1276.19995117,-2010.50000000,58.79999924,178.00000000,93,1,600); //Infernus
Reply
#6

ele nгo esta removendo porque essa public й chamada assim q o player abre a porta do carro, entгo ele й removido antes mesmo de estar dentro do carro
tente assim:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= GroveCars[0] && GetPlayerVehicleID(playerid) <= GroveCars[2])
        {
            if(gTeam[playerid] == Grove)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, -1, "Vo");
            }
        }
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by .FuneraL.
Посмотреть сообщение
Coloquei jб a explicaзгo no Code.
Man eu sei disso o negocio e que nгo ta egetando
Quote:
Originally Posted by ViictorDaay-
Посмотреть сообщение
pawn Код:
new GroveCars[4];

GroveCars[0] = AddStaticVehicleEx(498,1245.00000000,-2038.00000000,60.09999847,0.00000000,93,93,600); //Boxville
    GroveCars[1] = AddStaticVehicleEx(498,1276.30004883,-2038.00000000,60.00000000,0.00000000,93,93,600); //Boxville
    GroveCars[2] = AddStaticVehicleEx(411,1276.19995117,-2010.50000000,58.79999924,178.00000000,93,1,600); //Infernus
lol se ta loko?
Reply
#8

Porque estou loko
Reply
#9

Olб, boa noite.
Seguinte. Certifique-se de que as variaveis estгo de acordo para a execuзгo da funзгo.

e use
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        if(
GetPlayerVehicleID(playerid) >= GroveCars[0] && GetPlayerVehicleID(playerid) <= GroveCars[2])
        {
            if(
gTeam[playerid] == Grove)
            {
                
RemovePlayerFromVehicle(playerid);
                
SendClientMessage(playerid, -1"Vo");
            }
        }
    }
    return 
1;

Como citado acima!
Reply
#10

Para mais informaзхes re-leiam a samp wiki, veja aqui.


https://sampwiki.blast.hk/wiki/Control_Structures

pawn Код:
new GroveCars[3]; // vocкs sabem contar?
   
    GroveCars[0] = AddStaticVehicleEx(498,1245.00000000,-2038.00000000,60.09999847,0.00000000,93,93,600); //Boxville
    GroveCars[1] = AddStaticVehicleEx(498,1276.30004883,-2038.00000000,60.00000000,0.00000000,93,93,600); //Boxville
    GroveCars[2] = AddStaticVehicleEx(411,1276.19995117,-2010.50000000,58.79999924,178.00000000,93,1,600);

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) // funcionar aqui tбmbem...
{
   if(GetPlayerVehicleID(playerid) >= GroveCars[0] || GetPlayerVehicleID(playerid) <= GroveCars[2]) // o correto seria assim, e nгo &&, pois && й usado apenas quando estб usando ambas as funзхes e atй onde eu sei, o jogador nгo pode entrar em 2 veнculos ao mesmo tempo.
   {
        if(gTeam[playerid] == Grove)
        {
            RemovePlayerFromVehicle(playerid);
            SendClientMessage(playerid, -1, "Vo");
        }
   }
   return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)