SA-MP Forums Archive
Help with GetPlayerScore - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with GetPlayerScore (/showthread.php?tid=378396)



Help with GetPlayerScore - jaami - 17.09.2012

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.


Re: Help with GetPlayerScore - ViniBorn - 17.09.2012

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'


Re: Help with GetPlayerScore - Black Wolf - 17.09.2012

Show the code of SpawnVehicleForPlayer


Re: Help with GetPlayerScore - jaami - 18.09.2012

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?


Re: Help with GetPlayerScore - Black Wolf - 18.09.2012

duda i think stock needs to return a value.