SA-MP Forums Archive
How To Fix This Rank System ? - 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: How To Fix This Rank System ? (/showthread.php?tid=429337)



How To Fix This Rank System ? - Giroud12 - 09.04.2013

How To Fix This? Really Need Help

pawn Код:
#include <a_samp>

#define Soldier 0
#define Private First Class 1
#define Specialist 2
#define Corporal 3
#define Sargeant 4
#define Staff Sergeant 5
#define Sergeant Major 6
#define Command Sergeant Major 7
#define Lieutenant 8
#define Captain 9
#define Colonel 10
#define Brigadier General 11
#define Major Generals 12
#define General 13
#define Commander 14

new pRank[MAX_PLAYERS];
pRank[playerid] = RANK_Soldier;

forward CheckPlayerRank(playerid);
public CheckPlayerRank(playerid)
{
new iScore = GetPlayerScore(playerid);
switch(iScore)
{
case 0..100:
{
pRank[playerid] = RANK_Soldier;
{
case 0..100:
{
pRank[playerid] = RANK_Specialist;
{
case 0..100:
{
pRank[playerid] = RANK_Corporal;
{
case 0..100:
{
pRank[playerid] = RANK_Sergeant;
{
case 0..100:
{
pRank[playerid] = RANK_Staff Sergeant;
{
case 0..100:
{
pRank[playerid] = RANK_Sergeant Major ;
{
case 0..100:
{
pRank[playerid] = RANK_Command Sergeant Major ;
{
case 0..100:
{
pRank[playerid] = RANK_Lieutenant;
{
case 0..100:
{
pRank[playerid] = RANK_Captain;
{
case 0..100:
{
pRank[playerid] = RANK_Colonel;
{
case 0..100:
{
pRank[playerid] = RANK_Major General;
{
case 0..100:
{
pRank[playerid] = RANK_General;
{
case 0..100:
{
pRank[playerid] = RANK_Commander;


return 1;
}
Quote:

C:\Users\Murid\Documents\New Script\Ranks.pwn(22) : error 010: invalid function or declaration
C:\Users\Murid\Documents\New Script\Ranks.pwn(32) : error 017: undefined symbol "RANK_Soldier"
C:\Users\Murid\Documents\New Script\Ranks.pwn(34) : error 014: invalid statement; not in switch
C:\Users\Murid\Documents\New Script\Ranks.pwn(34) : warning 215: expression has no effect
C:\Users\Murid\Documents\New Script\Ranks.pwn(34) : error 001: expected token: ";", but found ".."
C:\Users\Murid\Documents\New Script\Ranks.pwn(34) : error 029: invalid expression, assumed zero
C:\Users\Murid\Documents\New Script\Ranks.pwn(34) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Errors.




Re: How To Fix This Rank System ? - iJumbo - 09.04.2013

use tags [ PAWN] [/ PAWN] to show your code here
And show lines.

I think you should do

like

pawn Код:
RANK_Command Sergeant Major to  RANK_Command_Sergeant_Major



Re: How To Fix This Rank System ? - Giroud12 - 09.04.2013

How About This?

Quote:

C:\Users\Murid\Documents\New Script\Ranks.pwn(32) : error 017: undefined symbol "RANK_Soldier"




Re: How To Fix This Rank System ? - iJumbo - 09.04.2013

You cant use per player variable as GLOBAL one.

for set the player rank to frist rank like when he connect just put the line

pawn Код:
pRank[playerid] = RANK_Soldier;
under OnPlayerConnect callback


Re: How To Fix This Rank System ? - yaron0600 - 09.04.2013

What the fuck is that !? "Case 0.0000"?!


Re: How To Fix This Rank System ? - iJumbo - 09.04.2013

And yeah that 0..100 case means "from 0 to 100" so do not put all ranks to "from 0 to 100" but put like "from 0 to 10 = to rank1" and so on


Re: How To Fix This Rank System ? - Giroud12 - 09.04.2013

Quote:

C:\Users\Murid\Documents\New Script\Ranks.pwn(21) : error 010: invalid function or declaration
C:\Users\Murid\Documents\New Script\Ranks.pwn(31) : error 017: undefined symbol "pRank"
C:\Users\Murid\Documents\New Script\Ranks.pwn(31) : warning 215: expression has no effect
C:\Users\Murid\Documents\New Script\Ranks.pwn(31) : error 001: expected token: ";", but found "]"
C:\Users\Murid\Documents\New Script\Ranks.pwn(31) : error 029: invalid expression, assumed zero
C:\Users\Murid\Documents\New Script\Ranks.pwn(31) : fatal error 107: too many error messages on one line

31 pRank[playerid] = RANK_Soldier;
Wat The Prob?


Re: How To Fix This Rank System ? - XStormiest - 09.04.2013

Not is case 0 to 100
case 0...100
Your script is very bugged and with not work at all.


Re: How To Fix This Rank System ? - Giroud12 - 09.04.2013

I Follow Ranks System Tutorial


Re: How To Fix This Rank System ? - RandomDude - 09.04.2013

I think you should re-follow it -_-