[Ajuda] Definir veiculos
#1

Bom , Galera , eu gostaria de definir os seguintes veiculos :

pawn Код:
// Carros Policia

    AddStaticVehicleEx(596,1545.13037109,-1607.79199219,13.20281219,264.99572754,-1,-1,15); //Police Car (LSPD)  [01]
    AddStaticVehicleEx(596,1545.08886719,-1610.79199219,13.20281219,264.99572754,-1,-1,15); //Police Car (LSPD)  [02]
    AddStaticVehicleEx(596,1545.04443359,-1614.04199219,13.20281219,264.99572754,-1,-1,15); //Police Car (LSPD)  [03]
    AddStaticVehicleEx(596,1545.44421387,-1604.58666992,13.20281219,264.99572754,-1,-1,15); //Police Car (LSPD)  [04]
    AddStaticVehicleEx(599,1527.15051270,-1646.22778320,6.27575159,180.00000000,-1,-1,15); //Police Ranger  [05]
    AddStaticVehicleEx(599,1530.89855957,-1646.35937500,6.27575159,180.00000000,-1,-1,15); //Police Ranger  [06]
    AddStaticVehicleEx(599,1537.89501953,-1646.60546875,6.27575159,180.00000000,-1,-1,15); //Police Ranger  [07]
    AddStaticVehicleEx(599,1590.92431641,-1708.48522949,6.27575159,0.00000000,-1,-1,15); //Police Ranger  [08]
    AddStaticVehicleEx(599,1583.93750000,-1708.02636719,6.27575159,0.00000000,-1,-1,15); //Police Ranger  [09]
    AddStaticVehicleEx(599,1578.94726562,-1707.69921875,6.27575159,0.00000000,-1,-1,15); //Police Ranger  [10]
    AddStaticVehicleEx(599,1570.44653320,-1708.18676758,6.27575159,0.00000000,-1,-1,15); //Police Ranger  [11]
    AddStaticVehicleEx(599,1574.19628906,-1708.19201660,6.27575159,0.00000000,-1,-1,15); //Police Ranger  [12]
    AddStaticVehicleEx(497,1561.27197266,-1618.77441406,13.81187534,150.00000000,-1,1,15); //Police Maverick  [13]
    AddStaticVehicleEx(523,1601.54370117,-1702.78076172,5.55100250,80.00000000,-1,-1,15); //HPV1000  [14]
    AddStaticVehicleEx(523,1601.54846191,-1699.03027344,5.55100250,79.99694824,-1,-1,15); //HPV1000  [15]
    AddStaticVehicleEx(523,1601.55407715,-1694.78027344,5.55100250,79.99694824,-1,-1,15); //HPV1000  [16]
    AddStaticVehicleEx(523,1601.55883789,-1691.28027344,5.55100250,79.99694824,-1,-1,15); //HPV1000  [17]
    AddStaticVehicleEx(523,1601.56445312,-1687.28027344,5.55100250,79.99694824,-1,-1,15); //HPV1000  [18]

// Carros Terrorista

    AddStaticVehicleEx(429,2746.04418945,-2445.92773438,13.39843750,270.00000000,6,1,15); //Banshee  [19]
    AddStaticVehicleEx(429,2746.16113281,-2442.93066406,13.39843750,270.00000000,6,1,15); //Banshee  [20]
    AddStaticVehicleEx(429,2745.92675781,-2448.92480469,13.39843750,270.00000000,6,1,15); //Banshee  [21]
    AddStaticVehicleEx(429,2746.28808594,-2439.68383789,13.39843750,270.00000000,6,1,15); //Banshee  [22]
    AddStaticVehicleEx(433,2745.27270508,-2431.99145508,14.21318436,270.00000000,-1,-1,15); //Barracks  [23]
    AddStaticVehicleEx(433,2745.63378906,-2422.75024414,14.21318436,270.00000000,-1,-1,15); //Barracks  [24]
    AddStaticVehicleEx(535,2748.01171875,-2459.22680664,13.48843765,270.00000000,6,6,15); //Slamvan  [25]
    AddStaticVehicleEx(535,2747.77734375,-2465.22070312,13.48843765,270.00000000,6,6,15); //Slamvan  [26]
    AddStaticVehicleEx(535,2747.52343750,-2471.71435547,13.48843765,270.00000000,6,6,15); //Slamvan  [27]
    AddStaticVehicleEx(447,2747.58935547,-2454.35888672,16.75622368,0.00000000,-1,-1,15); //Seasparrow  [28]
    AddStaticVehicleEx(447,2762.96264648,-2397.69165039,13.73281288,190.00000000,-1,-1,15); //Seasparrow  [29]
    AddStaticVehicleEx(470,2774.23901367,-2439.32299805,13.74698448,0.00000000,-1,-1,15); //Patriot  [30]
    AddStaticVehicleEx(463,2747.63330078,-2468.44458008,13.26543713,270.00000000,6,6,15); //Freeway  [31]
    AddStaticVehicleEx(463,2747.39160156,-2461.95068359,13.26543713,270.00000000,6,6,15); //Freeway  [32]
    AddStaticVehicleEx(463,2749.60717773,-2475.52539062,13.26543713,270.00000000,6,6,15); //Freeway  [33]
    AddStaticVehicleEx(463,2749.54785156,-2477.02392578,13.26543713,270.00000000,6,6,15); //Freeway  [34]
    AddStaticVehicleEx(463,2749.48925781,-2478.52197266,13.26543713,270.00000000,6,6,15); //Freeway  [35]
    AddStaticVehicleEx(463,2749.43066406,-2480.02001953,13.26543713,270.00000000,6,6,15); //Freeway  [36]
    AddStaticVehicleEx(463,2749.29394531,-2483.51586914,13.26543713,270.00000000,6,6,15); //Freeway  [37]
    AddStaticVehicleEx(463,2749.23535156,-2485.01416016,13.26543713,270.00000000,6,6,15); //Freeway  [38]
Tipo para um servidor de DM , Dai tipo os Terrorista poderiam entrar no carro (19 ao 28 ) e os Policias do (1 ao 18 ) Bom seria posivel ?
Reply
#2

pawn Код:
//public OnPlayerStateChange
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && !VariavelQueDefineQueEleЙPolicial[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && !VariavelQueDefineQueEleЙTerrorista[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
Reply
#3

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
//public OnPlayerStateChange
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && !VariavelQueDefineQueEleЙPolicial[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && !VariavelQueDefineQueEleЙTerrorista[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
Nгo tenho estб public, vou criar se der algum erro eu avisarei .
Reply
#4

Exemplo

pawn Код:
new CarroPolicia[3];
new CarroTerrorista[3];


// Carros Policia    
CarroPolicia[0] = CreateVehicle(596,1545.13037109,-1607.79199219,13.20281219,264.99572754,-1,-1,-1); //Police Car (LSPD)  [01]    
CarroPolicia[1] = CreateVehicle(596,1545.08886719,-1610.79199219,13.20281219,264.99572754,-1,-1,-1); //Police Car (LSPD)  [02]    
CarroPolicia[2] = CreateVehicle(596,1545.04443359,-1614.04199219,13.20281219,264.99572754,-1,-1,-1); //Police Car (LSPD)  [03]    


// Carros Terrorista    
CarroTerrorista[0] = CreateVehicle(429,2746.04418945,-2445.92773438,13.39843750,270.00000000,6,1,-1); //Banshee  [19]    
CarroTerrorista[1] = CreateVehicle(429,2746.16113281,-2442.93066406,13.39843750,270.00000000,6,1,-1); //Banshee  [20]    
CarroTerrorista[2] = CreateVehicle(429,2745.92675781,-2448.92480469,13.39843750,270.00000000,6,1,-1); //Banshee  [21]
Depois й sу usar isso em OnPlayerEnterVehicle ou OnPlayerStateChange, pra detectar se o jogador й da organizaзгo desejada.
Reply
#5

Deu os Seguintes Erros :

Quote:

H:\ftn.pwn(385) : error 001: expected token: ";", but found "if"
H:\ftn.pwn(387) : error 010: invalid function or declaration
H:\ftn.pwn(390) : error 010: invalid function or declaration
H:\ftn.pwn(392) : error 010: invalid function or declaration
H:\ftn.pwn(395) : error 010: invalid function or declaration

pawn Код:
//
public OnPlayerStateChange
// Aqui deu o Primeiro erro
    if(newstate == PLAYER_STATE_DRIVER)
    {
// aqui o segundo
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && !VariavelQueDefineQueEleЙPolicial[playerid])
        {
            RemovePlayerFromVehicle(playerid);
// Aqui o Terceiro
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
// Aqui o quarto
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && !VariavelQueDefineQueEleЙTerrorista[playerid])
        {
            RemovePlayerFromVehicle(playerid);
// O quinto aqui '-'
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
Reply
#6

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldastate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && !VariavelQueDefineQueEleЙPolicial[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && !VariavelQueDefineQueEleЙTerrorista[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
}

LEMBRE-SE DE TROCAR AS VARIAVEIS QUE DEFINEM C ELE Й POLICIAL OU TERRORISTA!!!!!!!!!!
Reply
#7

Quote:
Originally Posted by Pharrel
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldastate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && !VariavelQueDefineQueEleЙPolicial[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && !VariavelQueDefineQueEleЙTerrorista[playerid])
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
}

LEMBRE-SE DE TROCAR AS VARIAVEIS QUE DEFINEM C ELE Й POLICIAL OU TERRORISTA!!!!!!!!!!
Bom aqui agr у o spawn deles

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_CT)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerHealth(playerid, 100);
        SetPlayerColor(playerid,COLOR_BLUE);
        SendClientMessage(playerid, COLOR_BLUE, "Vocк й um Policial , Honre seu distintivo");
        GivePlayerWeapon(playerid, 24, 100);
        GivePlayerWeapon(playerid, 27, 50);
        GivePlayerWeapon(playerid, 29, 50);
        GivePlayerWeapon(playerid, 31, 10);
        SetPlayerPos(playerid, 1528.1552734375,-1673.0616455078,5.8679757118225);
    }
    else if(gTeam[playerid] == TEAM_T)
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerHealth(playerid, 100);
        SetPlayerColor(playerid,COLOR_RED);
        SendClientMessage(playerid, COLOR_RED, "Vocк estб no time dos Terroristas , Isso ai matar geral");
        SetPlayerPos(playerid, -201.22732543945,-79.062782287598,3.1171875);
        GivePlayerWeapon(playerid, 24, 100);
        GivePlayerWeapon(playerid, 27, 50);
        GivePlayerWeapon(playerid, 29, 50);
        GivePlayerWeapon(playerid, 31, 10);
        }
    return 1;
    }
Entгo a variavel seria TEAM_T ou TEAM_CT

So Novato ainda no pawno .
Reply
#8

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldastate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && Team[playerid] != TEAM_CT)
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && Team[playerid] != TEAM_T)
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
}
Reply
#9

Quote:

H:\ftn.pwn(385) : error 025: function heading differs from prototype
H:\ftn.pwn(400) : warning 209: function "OnPlayerStateChange" should return a value

№ Erro
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldastate)
№ Warning
pawn Код:
}
Code Completo :
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldastate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && Team[playerid] != TEAM_CT)
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && Team[playerid] != TEAM_T)
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
// й essa aqi
}
Reply
#10

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        if(GetPlayerVehicleID(playerid) >= 1 && GetPlayerVehicleID(playerid) <= 18 && Team[playerid] != TEAM_CT)
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й policial!");
        }
        else if(GetPlayerVehicleID(playerid) >= 19 && GetPlayerVehicleID(playerid) <= 28 && Team[playerid] != TEAM_T)
        {
            RemovePlayerFromVehicle(playerid);
            return SendClientMessage(playerid, -1, "Voce nгo й terrorista!");
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)