Invalid Function or Declaration HELP. -
xXryanXx - 19.01.2015
if(GetPlayerScore(playerid) >= 10) && (GetPlayerHealth(playerid) >0))
{
SetPlayerArmour(playerid, 10);
SendClientMessage(playerid, DeathColor, "You gain 10 armour on spawn because of your level.");
}
I have this under OnPlayerSpawn btw.
Tell me what i'm doing wrong and then feel free to insult my intelligence.
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\bryanworldv2.pwn(89) : error 010: invalid function or declaration
Re: Invalid Function or Declaration HELP. -
nezo2001 - 19.01.2015
PHP код:
if(GetPlayerScore(playerid) >= 10 && GetPlayerHealth(playerid) >0)
Re: Invalid Function or Declaration HELP. -
xXryanXx - 19.01.2015
That didn't work sadly.
Re: Invalid Function or Declaration HELP. -
Schneider - 19.01.2015
pawn Код:
new Float:Health;
GetPlayerHealth(playerid, Health);
if((GetPlayerScore(playerid) >= 10) && (Health > 0.0))
{
SetPlayerArmour(playerid, 10);
SendClientMessage(playerid, DeathColor, "You gain 10 armour on spawn because of your level.");
}
But why are you checking if the player is not dead at OnPlayerSpawn? Players are always alive when they spawn.
Re: Invalid Function or Declaration HELP. -
nezo2001 - 19.01.2015
PHP код:
new score = GetPlayerScore(playerid);
new Float:Health;
new health = GetPlayerHealth(playerid);
if(score >= 10 && health >0)
{
SetPlayerArmour(playerid, 10);
SendClientMessage(playerid, DeathColor, "You gain 10 armour on spawn because of your level.");
}
Edit: -_-.
Re: Invalid Function or Declaration HELP. -
xXryanXx - 19.01.2015
>Schneider, forgot to remove it when I had it on death.
Re: Invalid Function or Declaration HELP. -
xXryanXx - 19.01.2015
Nezo, that literally made the compiler crash.
Re: Invalid Function or Declaration HELP. -
xXryanXx - 19.01.2015
Neither of these work.
Re: Invalid Function or Declaration HELP. -
Schneider - 19.01.2015
pawn Код:
if(GetPlayerScore(playerid) >= 10)
{
SetPlayerArmour(playerid, 10);
SendClientMessage(playerid, DeathColor, "You gain 10 armour on spawn because of your level.");
}
Re: Invalid Function or Declaration HELP. -
xXryanXx - 19.01.2015
Код:
public OnPlayerSpawn(playerid)
if(GetPlayerTeam(playerid) == Bloods)
{
SetPlayerColor(playerid, BloodsColor); // Set his color to the BloodsColor (Red)
/* Any other bonus' you want to add to the Bloods team add it here. */
}
else if(GetPlayerTeam(playerid) ==Crips)
{
SetPlayerColor(playerid, CripsColor); // Same as above but in this case, CripsColor (Blue)
/* Any other bonus' you want to add to the Crips team add it here. */
}
if(GetPlayerScore(playerid) >= 10)
{
SetPlayerArmour(playerid, 10);
SendClientMessage(playerid, DeathColor, "You gain 10 armour on spawn because of your level.");
}
}
Here is the full OnPlayerSpawn part, it's still not working.