Help with GetPlayerScore
#1

PHP код:
    else if(gPlayerClass[playerid] == AIRFORCE)//This is for the Air Force class.
    
{
        if (
GetPlayerScore(playerid) >= 5500 && GetPlayerScore(playerid) <= 7000)
        {
            
TogglePlayerControllable(playerid1);
            
ResetPlayerWeapons(playerid);
            
SpawnVehicleForPlayer(447playerid);
        }
        if (
GetPlayerScore(playerid) >= 7000 && GetPlayerScore(playerid) <= 7500)
          {
            
TogglePlayerControllable(playerid1);
            
ResetPlayerWeapons(playerid);
            
SpawnVehicleForPlayer(425playerid);
        }
        if (
GetPlayerScore(playerid) >= 7500 && GetPlayerScore(playerid) <= 9000)
          {
            
TogglePlayerControllable(playerid1);
            
ResetPlayerWeapons(playerid);
            
SpawnVehicleForPlayer(520playerid);
        }
        if (
GetPlayerScore(playerid) >= 9000 && GetPlayerScore(playerid) <= 9500)
          {
            
TogglePlayerControllable(playerid1);
            
ResetPlayerWeapons(playerid);
            
SpawnVehicleForPlayer(592playerid);
        }
    } 
Any mistake why is the vehicle not spawned for them if they spawn.
Reply
#2

pawn Код:
else if(gPlayerClass[playerid] == AIRFORCE)//This is for the Air Force class.
{
    if (GetPlayerScore(playerid) >= 5500 && GetPlayerScore(playerid) <= 7000)
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        SpawnVehicleForPlayer(447, playerid);
    }
    else if (GetPlayerScore(playerid) > 7000 && GetPlayerScore(playerid) <= 7500)
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        SpawnVehicleForPlayer(425, playerid);
    }
    else if (GetPlayerScore(playerid) > 7500 && GetPlayerScore(playerid) <= 9000)
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        SpawnVehicleForPlayer(520, playerid);
    }
    else if (GetPlayerScore(playerid) > 9000 && GetPlayerScore(playerid) <= 9500)
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        SpawnVehicleForPlayer(592, playerid);
    }
}
If it don't work, the problem is in 'SpawnVehicleForPlayer'
Reply
#3

Show the code of SpawnVehicleForPlayer
Reply
#4

Quote:
Originally Posted by Black Wolf
Посмотреть сообщение
Show the code of SpawnVehicleForPlayer
PHP код:
stock SpawnVehicleForPlayer(vehicleidplayerid)
{
    if(
SpawnedVehicle[playerid] != 0)
    {
    
//Check, if player spawned any vehicle
        
DestroyVehicle(SpawnedVehicle[playerid]);
        
//Destroy it
    
}
    new 
Float:XFloat:YFloat:ZFloat:Angle;
    
//Variable to save playerґs X,Y,Z and angle
    
GetPlayerPos(playeridFloat:XFloat:YFloat:Z);
    
//Get player positions and save it to variables
    
GetPlayerFacingAngle(playeridFloat:Angle);
    
//Get player facing angle and save it to variable
    
SpawnedVehicle[playerid] = CreateVehicle(vehicleidXY2.0Angle 90.0, -1, -1600);
    
//Spawn vehicle with random color in front of player
    
SetVehicleVirtualWorld(SpawnedVehicle[playerid], GetPlayerVirtualWorld(playerid));
    
//Set vehicle virtual world to player virtual world
    
LinkVehicleToInterior(SpawnedVehicle[playerid], GetPlayerInterior(playerid));
    
//Set vehicle interior to player interior
    
PutPlayerInVehicle(playeridSpawnedVehicle[playerid], 0);
    
//Put player to spawned vehicle as driver

The code still does not work.. Anyone can help it?
Reply
#5

duda i think stock needs to return a value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)