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(playerid, 1);
ResetPlayerWeapons(playerid);
SpawnVehicleForPlayer(447, playerid);
}
if (GetPlayerScore(playerid) >= 7000 && GetPlayerScore(playerid) <= 7500)
{
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
SpawnVehicleForPlayer(425, playerid);
}
if (GetPlayerScore(playerid) >= 7500 && GetPlayerScore(playerid) <= 9000)
{
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
SpawnVehicleForPlayer(520, playerid);
}
if (GetPlayerScore(playerid) >= 9000 && GetPlayerScore(playerid) <= 9500)
{
TogglePlayerControllable(playerid, 1);
ResetPlayerWeapons(playerid);
SpawnVehicleForPlayer(592, playerid);
}
}
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(vehicleid, playerid)
{
if(SpawnedVehicle[playerid] != 0)
{
//Check, if player spawned any vehicle
DestroyVehicle(SpawnedVehicle[playerid]);
//Destroy it
}
new Float:X, Float:Y, Float:Z, Float:Angle;
//Variable to save playerґs X,Y,Z and angle
GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
//Get player positions and save it to variables
GetPlayerFacingAngle(playerid, Float:Angle);
//Get player facing angle and save it to variable
SpawnedVehicle[playerid] = CreateVehicle(vehicleid, X, Y, Z + 2.0, Angle + 90.0, -1, -1, 600);
//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(playerid, SpawnedVehicle[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.