*** 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) >= 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.
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 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;
}
Re: Error help -
Private200 - 24.10.2012
any solution ?