13.04.2018, 15:30
(
Последний раз редактировалось Dice_; 14.04.2018 в 06:19.
)
PHP код:
ReinitBusPassenger(id)
{
new skin, l, Float:x, Float:y, Float:z, Float:a;
print("called 1");
for(new i; i < MAX_GLOBAL_PASSENGERS; i++)
{
switch(id)
{
case 1:
{
if(!IsValidActor(PassengerActor[i]))
{
skin = random(311) + 1;
do
{
l = random(sizeof(PassengerLocations));
}
while(GlobalLocationsCount[l] >= 6);
GlobalLocationsCount[l]++;
x = PassengerLocations[l][0];
y = PassengerLocations[l][1];
z = PassengerLocations[l][2];
a = PassengerLocations[l][3];
x -= (frandom(1.5) * floatsin(-a, degrees));
y -= (frandom(1.5) * floatcos(-a, degrees));
x += ((1.0 * float(GlobalLocationsCount[l])) * floatsin(absoluteangle(a + 90.0), degrees));
y += ((1.0 * float(GlobalLocationsCount[l])) * floatcos(absoluteangle(a + 90.0), degrees));
PassengerActor[i] = CreateActor(skin, x, y, z, a);
print("called case 1");
}
}
case 2:
{
if(!IsValidActor(PassengerActor2[i]))
{
skin = random(311) + 1;
do
{
l = random(sizeof(PassengerLocations2));
}
while(GlobalLocationsCount2[l] >= 7);
GlobalLocationsCount2[l]++;
x = PassengerLocations2[l][0];
y = PassengerLocations2[l][1];
z = PassengerLocations2[l][2];
a = PassengerLocations2[l][3];
x -= (frandom(1.5) * floatsin(-a, degrees));
y -= (frandom(1.5) * floatcos(-a, degrees));
x += ((1.0 * float(GlobalLocationsCount2[l])) * floatsin(a + 90.0, degrees));
y += ((1.0 * float(GlobalLocationsCount2[l])) * floatcos(a + 90.0, degrees));
PassengerActor2[i] = CreateActor(skin, x, y, z, a);
print("called case 2");
}
}
}
}
}
I don't understand though why Actor isn't created even though it's not related to CreateDynamicActor