18.08.2012, 20:01
Sooo I have this code, and there are six posibilites of spawning in random areas. But I want it: If the place is already taken, you can't spawn there.. Any help :> ?
PHP код:
public OnPlayerSpawn(playerid)
{
if(pInfo[playerid][pVIP] == 1) SetPlayerColor(playerid,0xFF0000);
new Float:RandomSpawn[][3] =
{
{3782.6897,-1919.2844,2.2270},
{3770.6841,-1912.3002,2.2271},
{3777.3240,-1914.1091,2.2271},
{3782.6748,-1913.8456,2.2271},
{3788.4456,-1914.4016,2.2271},
{3794.0837,-1914.7858,2.2271}
};
new rand = random(sizeof(RandomSpawn));
new Car = CreateVehicle(411,RandomSpawn[rand][0],RandomSpawn[rand][1],RandomSpawn[rand][2],0,0,0,0);
PutPlayerInVehicle(playerid,Car,0);
SetPlayerInterior(playerid, 0);
new pveh;
new PlayerIn[MAX_PLAYER_NAME];
for(new i=0;i<MAX_VEHICLES;i++)
{
if(PlayerIn[i] == 0)
{
pveh = i;
break;
}
}
PutPlayerInVehicle(playerid,pveh,0);
PlayerIn[pveh] = 1;
return 1;
}