Need help with this, please! -
leapfish - 03.02.2010
Hello,
I need help with Ranking system, I want to add it to LS:TWSE gamemode...
This is what I tried...
Код:
if(PlayerInfo[playerid][ pScore ] >= 0 && (PlayerInfo[playerid][ pScore ] <=49 ) { // Baby Killer
SetPlayerHealth(playerid, 50.0);
GivePlayerWeapon(playerid, 22, 300);
GivePlayerWeapon(playerid, 17, 500);
}
else if(PlayerInfo[playerid][ pScore ] >= 50 && (PlayerInfo[playerid][ pScore ] <= 199) { // Killer
SetPlayerHealth(playerid, 60.0);
SetPlayerArmour(playerid, 15.0);
GivePlayerWeapon(playerid, 23, 300);
GivePlayerWeapon(playerid, 17, 500);
GivePlayerWeapon(playerid, 5, 1);
}
else if(PlayerInfo[playerid][ pScore ] >= 200 && (PlayerInfo[playerid][ pScore ] <= 499) { // Serial Killer
SetPlayerHealth(playerid, 70.0);
SetPlayerArmour(playerid, 25.0);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 5, 1);
}
else if(PlayerInfo[playerid][ pScore ] >= 500 && (PlayerInfo[playerid][ pScore ] <= 999) { // Professional Killer
SetPlayerHealth(playerid, 80.0);
SetPlayerArmour(playerid, 50.0);
GivePlayerWeapon(playerid, 29, 200);
GivePlayerWeapon(playerid, 24, 150);
}
else if(PlayerInfo[playerid][ pScore ] >= 1000 && (PlayerInfo[playerid][ pScore ] <= 1999) { // Killing Machine
SetPlayerHealth(playerid, 90.0);
SetPlayerArmour(playerid, 75.0);
GivePlayerWeapon(playerid, 34, 100);
GivePlayerWeapon(playerid, 24, 300);
}
else if(PlayerInfo[playerid][ pScore ] >= 2000) { // God of War
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 27, 100);
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 31, 500);
}
return 1;
}
But when I try to compile it I get this error
Код:
error 010: invalid function or declaration
On every line where it says if(PlayerInfo[playerid][ pScore ]
Please can you help me to solve this, also if not a problem...
Can you tell me how to make textdraw to show player for each rank under health bar and money;
Baby Killer;
Killer;
Serial Killer;
Professional Killer;
Killing Machine;
God of War;
-----------------------------
I need it as soon as possible, please help me!!!
Re: Need help with this, please! -
notime - 03.02.2010
look at it:
Код:
if(PlayerInfo[playerid][ pScore ] >= 0 && (PlayerInfo[playerid][ pScore ] <=49 )
whats missing, i count 1,2 open brackets "("
and i count 1,huh? closing brackets ")"
means u need an extra ")" at the end so:
Код:
if(PlayerInfo[playerid][ pScore ] >= 0 && (PlayerInfo[playerid][ pScore ] <=49 ))
Re: Need help with this, please! -
leapfish - 03.02.2010
Thanks for replying Notime,
But I still get same error
Re: Need help with this, please! -
notime - 03.02.2010
try without the space bars at the "[ pScore ]" so it will be "[pScore]"
im not sure it matters but atleast you can try
Re: Need help with this, please! -
leapfish - 03.02.2010
Ahh still the same...
Maybe I put this in wrong place?
Currenlty it's under OnPlayerSpawn...
Is it good?
Re: Need help with this, please! -
armyoftwo - 03.02.2010
Show us the error line..
Re: Need help with this, please! -
leapfish - 03.02.2010
Код:
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1129) : error 010: invalid function or declaration
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1135) : error 010: invalid function or declaration
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1143) : error 010: invalid function or declaration
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1150) : error 010: invalid function or declaration
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1157) : error 010: invalid function or declaration
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1164) : error 010: invalid function or declaration
D:\Program Files\Rockstar Games\GTA San Andreas\SA-MP Server\gamemodes\LSTWSE1.pwn(1171) : error 010: invalid function or declaration
Re: Need help with this, please! -
armyoftwo - 03.02.2010
Код:
if(PlayerInfo[playerid][ pScore ] >= 0 && (PlayerInfo[playerid][ pScore ] <=49 )) { // Baby Killer
SetPlayerHealth(playerid, 50.0);
GivePlayerWeapon(playerid, 22, 300);
GivePlayerWeapon(playerid, 17, 500);
}
else if(PlayerInfo[playerid][ pScore ] >= 50 && (PlayerInfo[playerid][ pScore ] <= 199)) { // Killer
SetPlayerHealth(playerid, 60.0);
SetPlayerArmour(playerid, 15.0);
GivePlayerWeapon(playerid, 23, 300);
GivePlayerWeapon(playerid, 17, 500);
GivePlayerWeapon(playerid, 5, 1);
}
else if(PlayerInfo[playerid][ pScore ] >= 200 && (PlayerInfo[playerid][ pScore ] <= 499)) { // Serial Killer
SetPlayerHealth(playerid, 70.0);
SetPlayerArmour(playerid, 25.0);
GivePlayerWeapon(playerid, 24, 150);
GivePlayerWeapon(playerid, 5, 1);
}
else if(PlayerInfo[playerid][ pScore ] >= 500 && (PlayerInfo[playerid][ pScore ] <= 999)) { // Professional Killer
SetPlayerHealth(playerid, 80.0);
SetPlayerArmour(playerid, 50.0);
GivePlayerWeapon(playerid, 29, 200);
GivePlayerWeapon(playerid, 24, 150);
}
else if(PlayerInfo[playerid][ pScore ] >= 1000 && (PlayerInfo[playerid][ pScore ] <= 1999)) { // Killing Machine
SetPlayerHealth(playerid, 90.0);
SetPlayerArmour(playerid, 75.0);
GivePlayerWeapon(playerid, 34, 100);
GivePlayerWeapon(playerid, 24, 300);
}
else if(PlayerInfo[playerid][ pScore ] >= 2000) { // God of War
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 27, 100);
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 31, 500);
}
I dont know if it works but you should give it a try
Re: Need help with this, please! -
notime - 03.02.2010
heres the thing, i tested the if(blabla)
and for me it works, with all the tabs u got, its excact the same, only i used the stuff i got define so i changed the PlayerInfo to AccountInfo(thats how i got it define) and it all worked, so show me how did u define the PlayerInfo?
Re: Need help with this, please! -
leapfish - 03.02.2010
Hmm pScore is not defined, it just saves score in .ini file of user, and I want it to use it for ranking system