How To Fix This Rank System ?
#1

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.

Reply
#2

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
Reply
#3

How About This?

Quote:

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

Reply
#4

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
Reply
#5

What the fuck is that !? "Case 0.0000"?!
Reply
#6

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
Reply
#7

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?
Reply
#8

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

I Follow Ranks System Tutorial
Reply
#10

I think you should re-follow it -_-
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)