[AJUDA] Carro some depois que o outro player entra
#1

Gente, eu nгo sei o que deu no meu GM, por que, tipo, eu criei uns carros pelo SAVE, ai fui e coloquei no GM, mais tipo, quando algum player entra, blz, normal, mais quando o outro jogador vai entrar, o carro do primeiro player some, me falem ai o por que !!! aqui o cуdigo:

pawn Код:
AddStaticVehicle(536,1301.4843,-1874.1925,13.2886,89.5172,1,1); // Blade
    AddStaticVehicle(536,1290.8989,-1866.8478,13.2845,270.3344,24,24); // Blade
    AddStaticVehicle(562,-2391.9128,-598.7459,132.3081,124.9911,60,60); // Elegy
    AddStaticVehicle(402,-2395.5298,-593.8348,132.4801,125.5012,24,24); // Buffalo
    AddStaticVehicle(471,-2398.3755,-588.2693,132.1302,126.3298,1,1); // Quad
    AddStaticVehicle(562,-317.9525,1513.8268,75.0174,357.9193,1,1); // Elegy 1 DrF 2
    AddStaticVehicle(562,-324.1547,1513.5488,75.0178,1.4953,0,0); // Elegy 2 DrF 2
    AddStaticVehicle(562,-330.5574,1513.5717,75.0181,1.0843,24,24); // Elegy 3 DrF 2
    AddStaticVehicle(562,-336.4578,1513.5277,75.0195,0.0939,123,123); // Elegy 5 DrF 2
    AddStaticVehicle(562,-342.9501,1513.6655,75.0205,180.7668,60,60); // Elegy 8 DrF 2
    AddStaticVehicle(535,-342.5573,1543.0592,75.3258,180.0877,86,86); // Slavamn DrF 2
    AddStaticVehicle(494,-291.1456,1541.3596,75.2545,224.2404,1,1); // Hotring DrF 2
    AddStaticVehicle(541,-297.0208,1547.3271,74.9843,225.2980,0,0); // Bullet DrF 2
    AddStaticVehicle(567,-302.6321,1553.0693,75.2298,223.7278,1,1); // Slavann DrF 2
    AddStaticVehicle(536,-308.0684,1558.6893,75.0968,224.6265,1,1); // Blade DrF 2
    AddStaticVehicle(521,-314.2507,1572.9225,74.9302,45.1615,1,1); // FCR-500 DrF 2
    AddStaticVehicle(521,-313.0471,1563.9559,74.9259,221.6467,1,1); // FCR-500 DrF 2
    AddStaticVehicle(562,1244.6943,-2018.9102,59.5238,269.6833,3,3); // Elegy DrF 3
    AddStaticVehicle(562,1254.7646,-2009.2438,59.2294,180.5028,1,1); // Elegy DrF 3
    AddStaticVehicle(562,1277.7096,-2014.9553,58.5810,90.2327,0,0); // Elegy DrF 3
    AddStaticVehicle(562,1273.8132,-2043.9380,58.7382,359.2117,24,24); // Elegy DrF 3
Reply
#2

Posta o OnPlayerEnterVehicle e OnPlayerStateChange.
Reply
#3

OnPlayerEntrerVehicle:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 562)
    {
    ShowPlayerDialog(playerid,Infoo+16,DIALOG_STYLE_MSGBOX,".:: DrF - Informaзхes do Carro ::.","~>Que tunar seu carro? Digite: /Tunar\n~>Quer reparar e desvirar seu carro? Digite: /Ajuda","\n ","Fechar");
    return 1;
    }
    SendClientMessage(playerid, 0xAAAAAAAA, ".::[INFO] Este Servidor Possui Sistema Anti-Roubo, Caso Roubar Serб Morto Automaticamente !");
    if(!ispassenger && IsVehicleOccupied(vehicleid)) SetPlayerHealth(playerid, 0.0);
    return 1;
    }
    stock IsVehicleOccupied(vehicleid)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    return 1;
    return 0;
}
Agora o OnPlayerStateChange:
pawn Код:
// Nгo tem o OnPlayerStateChange
Reply
#4

UP Ninguem Ajuda ae plix Desculpe o Double Post
Reply
#5

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsVehicleOccupied(vehicleid)) return SetPlayerHealth(playerid, 0.0);
    SendClientMessage(playerid, 0xAAAAAAAA, ".::[INFO] Este Servidor Possui Sistema Anti-Roubo, Caso Roubar Serб Morto Automaticamente !");
    if(GetVehicleModel(vehicleid) == 562)
    {
        ShowPlayerDialog(playerid,Infoo+16,DIALOG_STYLE_MSGBOX,".:: DrF - Informaзхes do Carro ::.","~>Que tunar seu carro? Digite: /Tunar\n~>Quer reparar e desvirar seu carro? Digite: /Ajuda","\n ","Fechar");
    }
    return 1;
}

stock IsVehicleOccupied(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    return 1;
}
tenta ...
Reply
#6

Quote:
Originally Posted by TheGarfield
Посмотреть сообщение
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsVehicleOccupied(vehicleid)) return SetPlayerHealth(playerid, 0.0);
    SendClientMessage(playerid, 0xAAAAAAAA, ".::[INFO] Este Servidor Possui Sistema Anti-Roubo, Caso Roubar Serб Morto Automaticamente !");
    if(GetVehicleModel(vehicleid) == 562)
    {
        ShowPlayerDialog(playerid,Infoo+16,DIALOG_STYLE_MSGBOX,".:: DrF - Informaзхes do Carro ::.","~>Que tunar seu carro? Digite: /Tunar\n~>Quer reparar e desvirar seu carro? Digite: /Ajuda","\n ","Fechar");
    }
    return 1;
}

stock IsVehicleOccupied(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
    return 1;
}
tenta ...
Nгo funciono e ainda aumento 1 warning, ajuda ai
Reply
#7

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 562)
    {
        ShowPlayerDialog(playerid,Infoo+16,DIALOG_STYLE_MSGBOX,".:: DrF - Informaзхes do Carro ::.","~>Que tunar seu carro? Digite: /Tunar\n~>Quer reparar e desvirar seu carro? Digite: /Ajuda","\n ","Fechar");
        return true;
    }
    SendClientMessage(playerid, 0xAAAAAAAA, ".::[INFO] Este Servidor Possui Sistema Anti-Roubo, Caso Roubar Serб Morto Automaticamente !");
    if(!ispassenger && IsVehicleOccupied(vehicleid)) SetPlayerHealth(playerid, 0.0);
    return true;
}
No Final do GM :

pawn Код:
stock IsVehicleOccupied(vehicleid)
{
  for(new i = 0; i < MAX_PLAYERS; i++)
  if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
}
Ver nй :C
Reply
#8

Nao presto, que droga, vai ter que continuar assim por que
Reply
#9

Quote:
Originally Posted by ViCtOr_Mc
Посмотреть сообщение
Nao presto, que droga, vai ter que continuar assim por que
talvez nгo й a public certa ї
Reply
#10

Quote:
Originally Posted by TheGarfield
Посмотреть сообщение
talvez nгo й a public certa ї
Nгo e a publica certa sim, sу que nгo estб funcionando...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)