Help mee...
#2

you need to make a global variable for every player like
pawn Код:
new SpawnedCars[MAX_PLAYERS][3];
then onplyerconnect go
pawn Код:
SpawnedCars[playerid][0] = -1;
SpawnedCars[playerid][1] = -1;
SpawnedCars[playerid][2] = -1;
then find the players free slot
do this at the top of OnDialogResponse(
pawn Код:
new scid = -1;
for(new i=0;i<3;i++){
    if(i == -1) {
        scid = i;
        break;
    }
}
if(scid == -1){ //if all slots are full delete the cars from the server
    DestroyVehicle(SpawnedCars[playerid][0]);
    DestroyVehicle(SpawnedCars[playerid][1]);
    DestroyVehicle(SpawnedCars[playerid][2]);
    SpawnedCars[playerid][0] = -1;
    SpawnedCars[playerid][1] = -1;
    SpawnedCars[playerid][2] = -1;
    scid = 0;
}
then you need to store the vehicle id to these values when a player creates a car like
pawn Код:
SpawnedCars[playerid][scid] = CreateVehicle(.........
also go ondisconect
pawn Код:
DestroyVehicle(SpawnedCars[playerid][0]);
DestroyVehicle(SpawnedCars[playerid][1]);
DestroyVehicle(SpawnedCars[playerid][2]);
hope that helps untested pm me if you have any questions
Reply


Messages In This Thread
Help mee... - by styl3raaa - 08.02.2011, 17:28
Re: Help mee... - by (SF)Noobanatior - 09.02.2011, 03:57

Forum Jump:


Users browsing this thread: 1 Guest(s)