Cars disapeared
#1

I tried to make some cars only for Army Members,i did it good (i think) complied without any errors..but when i tried to test it IG i couldn't see any vehicle,all dismissed.
This is how i made this.
Код:
enum TeamCars
{
Army
}
@ the top
Код:
new Cars[TeamCars];
under

Then THIs:
Код:
Cars[Army] =  AddStaticVehicle(432,2795.45410156,-2417.37695312,13.73352051,90.00000000,-1,-1); //Rhino
To every car i want
and
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Army] )
        {
            if(gTeam[playerid] != TEAM_ARMY)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You don't have keys for this vehicle!");
                 return 1;
            }
        }
        return 1;
    }
    return 1;
}
I think i made it good and i think the problem is in AddStaticVehicle .. (i'm using streamer).

Hope someone can help,thanks.
Reply
#2

Quote:
Originally Posted by Kobatz
Посмотреть сообщение
I tried to make some cars only for Army Members,i did it good (i think) complied without any errors..but when i tried to test it IG i couldn't see any vehicle,all dismissed.
This is how i made this.
Код:
enum TeamCars
{
Army
}
@ the top
Код:
new Cars[TeamCars];
under

Then THIs:
Код:
Cars[Army] =  AddStaticVehicle(432,2795.45410156,-2417.37695312,13.73352051,90.00000000,-1,-1); //Rhino
To every car i want
and
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Army] )
        {
            if(gTeam[playerid] != TEAM_ARMY)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You don't have keys for this vehicle!");
                 return 1;
            }
        }
        return 1;
    }
    return 1;
}
I think i made it good and i think the problem is in AddStaticVehicle .. (i'm using streamer).

Hope someone can help,thanks.
Try this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == 2)
    {
        new CarCheck = GetPlayerVehicleID(playerid);
        if(CarCheck == Cars[Army] )
        {
            if(gTeam[playerid] != TEAM_ARMY)
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_RED, "You don't have keys for this vehicle!");
            }
        }
    }
    return 1;
}
Reply
#3

Didn't helped. :S

Anyone else?
Reply
#4

pawn Код:
new cararmy;

public OnGameModeInit( )
{
    cararmy = AddStaticVehicle( 432,2795.45410156,-2417.37695312,13.73352051,90.00000000, 5, 5 );
    return 1;
}

public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( newstate == PLAYER_STATE_DRIVER )
    {
        if( GetPlayerVehicleID( playerid ) == cararmy && gTeam[ playerid ] != TEAM_ARMY )
        {
            SendClientMessage( playerid, COLOR_RED, "You don't have keys for this vehicle!" );
            RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Should work.
Reply
#5

I did what u said Mean,complied without any errors,but still i can't see any vehicle IG.


Fking weird. :S

This might help:
I had same problem with objects,when i was creating moving gates.
When i typed Armgate1 = CreateDynamicObject(blbla); it didn't worked(objects were invisble) but later i changed it to Armygate1 = CreateObject = (blabla); and it worked(they were where they should be).
Reply
#6

Got no friggin idea, the provided code I gave is just tested, and it worked... Maybe you have too many vehicles? Exceeding the limit. Get a streamer if you do.
Reply
#7

I already got streamer. :S :S

O.o :S
Reply
#8

Ofc, that's why! You can't have streamed and normal AddStaticVehicle vehicles!
Reply
#9

Well,what to do then ? xD
Reply
#10

AddDynamicVehicle instead of AddStaticVehicle, depending on what streamer you are using.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)