15.11.2012, 22:01
I created 4 separate Teams I created them Teams with Private vehicles.. Only that Certain Team Can Have access To Them.. Vehicles.. So I Done the code as I supposed it would work Well It Did At First.. For the First Team.. Then When i added the Others it all Messed up The first team Has Control of all the teams Vehicles And I just Noticed when i was trying to fix them i tried jump into a Public Vehicle It Kicked me out of the vehicle Telling me Im not part Of the First Team.. So Ill show you My Codes Hopefully it helps .. Other then that Im screwed I even tried OnPlayerEnterVehicle Ha It made everything alot worse Im confused .. I thought i did it all Right.. Obviously Not..
New Variable i guess that's How you Spell It
OnGameModeInit
New Stock To Count My Created Private FireDepartment Vehicles
OnPlayerStateChange
Please Help Me The Only I cant Seem to Get Right.. Hehe the Other teams are Similar to all that codes But Named Different and Different Vehicles ETC....
New Variable i guess that's How you Spell It
pawn Код:
new FiremanVehicle[12];
pawn Код:
FiremanVehicle[1] = AddStaticVehicleEx(596,869.7223,-2384.4746,12.8661,22.3586,3, 3, -1); // LSFD Cheif Car
FiremanVehicle[2] = AddStaticVehicleEx(490,872.8439,-2383.2832,12.8672,25.0720,3, 3, -1); // LSFD SUVtruck
FiremanVehicle[3] = AddStaticVehicleEx(407,833.9660,-2397.6414,13.3359,297.7759,-1,-1, -1); // lsfd Firetruck 1
FiremanVehicle[4] = AddStaticVehicleEx(407,830.2823,-2386.3196,13.3339,295.2881,-1,-1, -1); // lsfd Firetruck 2
FiremanVehicle[5] = AddStaticVehicleEx(407,827.9481,-2381.1416,13.3366,296.5882,-1,-1, -1); // lsfd Firetruck 3
FiremanVehicle[6] = AddStaticVehicleEx(407,826.7319,-2376.0515,13.3359,296.0691,-1,-1, -1); // lsfd Firetruck 4
FiremanVehicle[7] = AddStaticVehicleEx(407,838.5652,-2404.7583,13.3353,296.8924,-1,-1, -1); // lsfd Firetruck 5
FiremanVehicle[8] = AddStaticVehicleEx(563,901.0341,-2409.2175,13.0966,103.6467,1, 3, -1); // LSFD heli 1
FiremanVehicle[9] = AddStaticVehicleEx(563,856.3829,-2457.7234,28.9835,354.1856,1, 3, -1); // LSFD heli 2
FiremanVehicle[10] = AddStaticVehicleEx(563,842.2261,-2445.0054,28.9835,329.4261,1, 3, -1); // LSFD heli 3
FiremanVehicle[11] = AddStaticVehicleEx(563,837.8069,-2416.5823,34.9835,300.6761,1, 3, -1); // LSFD heli 4
pawn Код:
stock CountFireTrucks()
{
new count;
for(new FV=0; FV != 12; FV++)
{
if(FiremanVehicle[FV] != INVALID_VEHICLE_ID)
SetVehicleNumberPlate(FiremanVehicle[FV], "LSFD");
SetVehicleToRespawn(FiremanVehicle[FV]);
count ++;
}
return count;
}
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
{
new count;
new Vehicle = GetPlayerVehicleID(playerid);
for(new FV=0; FV != 12; FV++)
{
if( Vehicle == FiremanVehicle[FV])
{
if(PlayerInfo[playerid][pFireTeam] == 2)
{
SendClientMessage(playerid, 0x33AA33AA, "You're Not A Fireman!");
RemovePlayerFromVehicle(playerid);
}
else
{
format(string1, sizeof(string1), "You Entered A %s, Owned By LSFD", VehicleNames[GetVehicleModel(Vehicle) -400]);
SendClientMessage(playerid, LIGHTRED, string1);
}
}
count ++;
}
return count;
}