SA-MP Forums Archive
*** Terrible Title Removed - 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: *** Terrible Title Removed (/showthread.php?tid=387444)



*** Terrible Title Removed - Private200 - 24.10.2012

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


Re: Error help - gtakillerIV - 24.10.2012

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


Re: Error help - Private200 - 24.10.2012

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


Re: Error help - gtakillerIV - 24.10.2012

There you go:

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

PHP код:
else if(GetPlayerScore(playerid) >= 0rankplayerid ] = 0
You were trying to store a string in an integer.


Re: Error help - Private200 - 24.10.2012

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 ?


Re: Error help - ViniBorn - 24.10.2012

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");
}



Re: Error help - Private200 - 24.10.2012

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


Re: Error help - RedJohn - 24.10.2012

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



Re: Error help - Private200 - 24.10.2012

Here whole code is

PHP код:
#include <a_samp>

new Text:Textdraw2;
new 
rankMAX_PLAYERS ];

public 
OnFilterScriptInit()
{
    
Textdraw2 TextDrawCreate(390.0000000.000000"Rank:~r~");
    
TextDrawBackgroundColor(Textdraw216711935);
    
TextDrawFont(Textdraw21);
    
TextDrawLetterSize(Textdraw20.5700002.700000);
    
TextDrawColor(Textdraw265535);
    
TextDrawSetOutline(Textdraw21);
    
TextDrawSetProportional(Textdraw21);
    return 
1;
}

public 
OnPlayerSpawnplayerid )
{
    
TextDrawShowForPlayerplayeridTextdraw2 );
    return 
1;
}

public 
OnPlayerUpdateplayerid )
{
    new 
string128 ];
    if(
GetPlayerScore(playerid) >= 1000rankplayerid ] = 6;
    else if(
GetPlayerScore(playerid) >= 700rankplayerid ] = 5;    
    else if(
GetPlayerScore(playerid) >= 500rankplayerid ] = 4;
    else if(
GetPlayerScore(playerid) >= 200rankplayerid ] = 3;
    else if(
GetPlayerScore(playerid) >= 100rankplayerid ] = 2;
    else if(
GetPlayerScore(playerid) >= 50rankplayerid ] = 1;
    else if(
GetPlayerScore(playerid) >= 0rankplayerid ] = 0;
    
formatstringsizeof string"Rank:~r~ %d"rankplayerid ] );
    
TextDrawSetStringTextdraw2string );
    return 
1;




Re: Error help - Private200 - 24.10.2012

any solution ?