*** Terrible Title Removed
#1

I have this error when i try to compile it .

pawn Код:
D:\Downloads\Rank_and_Info\Stats.pwn(59) : error 001: expected token: ";", but found "-string-"
I want to have my own ranks like example .

If player reach 50 score he goes to " Trucker "
or when he reach 100 score he goes to " Respected Trucker "

Like this . Help please
Reply
#2

Look for the line 59 then see line 58 and there should be a missing semi colon at the end of it.
Reply
#3

pawn Код:
else if(GetPlayerScore(playerid) >= 50) rank[ playerid ] = 1; //line 58
else if(GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0 "Wannable Trucker"; //line 59
nothing missing
Reply
#4

There you go:

PHP код:
else if(GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0 "Wannable Trucker"; 
Should be:

PHP код:
else if(GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0; 
You were trying to store a string in an integer.
Reply
#5

Yes but how can i make my own rank ? example when he go to 0 rank , when he starts playing i mean , he is a Newbie Trucker . I need this rank . How can i add it ?
Reply
#6

Create an array for this.

Ex:
pawn Код:
new pRank[MAX_PLAYERS][24];
pawn Код:
else if(GetPlayerScore(playerid) >= 0)
{
    rank[ playerid ] = 0;
    format(pRank[playerid],24,"Wannable Trucker");
}
Reply
#7

Can someone create a filterscript for that ? I really don't know how to do it
Reply
#8

Give us whole function where you use:

Код:
else if(GetPlayerScore(playerid) >= 50) rank[ playerid ] = 1; //line 58
else if(GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0 "Wannable Trucker"; //line 59
Reply
#9

Here whole code is

PHP код:
#include <a_samp>

new Text:Textdraw2;
new 
rank[ MAX_PLAYERS ];

public 
OnFilterScriptInit()
{
    
Textdraw2 = TextDrawCreate(390.000000, 0.000000, "Rank:~r~");
    
TextDrawBackgroundColor(Textdraw2, 16711935);
    
TextDrawFont(Textdraw2, 1);
    
TextDrawLetterSize(Textdraw2, 0.570000, 2.700000);
    
TextDrawColor(Textdraw2, 65535);
    
TextDrawSetOutline(Textdraw2, 1);
    
TextDrawSetProportional(Textdraw2, 1);
    return 
1;
}

public 
OnPlayerSpawn( playerid )
{
    
TextDrawShowForPlayer( playerid, Textdraw2 );
    return 
1;
}

public 
OnPlayerUpdate( playerid )
{
    new 
string[ 128 ];
    if(
GetPlayerScore(playerid) >= 1000) rank[ playerid ] = 6;
    else if(
GetPlayerScore(playerid) >= 700) rank[ playerid ] = 5;    
    else if(
GetPlayerScore(playerid) >= 500) rank[ playerid ] = 4;
    else if(
GetPlayerScore(playerid) >= 200) rank[ playerid ] = 3;
    else if(
GetPlayerScore(playerid) >= 100) rank[ playerid ] = 2;
    else if(
GetPlayerScore(playerid) >= 50) rank[ playerid ] = 1;
    else if(
GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0;
    
format( string, sizeof string, "Rank:~r~ %d", rank[ playerid ] );
    
TextDrawSetString( Textdraw2, string );
    return 
1;
} 
Reply
#10

any solution ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)