SA-MP Forums Archive
strings help - 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: strings help (/showthread.php?tid=629724)



strings help - silverms - 02.03.2017

hey so I have this string for but it isn't working good
PHP код:
CMD:rank(playeridparams[])
{
    new 
string[380];
    
format(string,sizeof(string), "Your Current Rank Is:%s"pRank(playerid));
    
SendClientMessage(playeridCOLOR_GREENstring);
    
//if(!strcmp(Rank[i],"RANKNAME")){}
    
return 1;

the problem is it is reading from the file that give it the names and every thing it is saying that you current rant is: uest there is G isn't saying it
and here the pRank(playerid)
PHP код:
stock pRank(playerid)
{
    new 
playername[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    
dini_Get(AddDirFile(dir_userfilesplayername), "Rank");
    return 
1;




Re: strings help - Toroi - 02.03.2017

Try changing the value pRank returns:

Код:
stock pRank(playerid) 
{ 
    new playername[MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME); 
    dini_Get(AddDirFile(dir_userfiles, playername), "Rank"); 
    return playername; 
}



Re: strings help - silverms - 02.03.2017

it sended me my name not my rank


Re: strings help - Toroi - 02.03.2017

Sorry, i was not paying attention at all, try this:

Код:
stock pRank(playerid) 
{ 
    new playername[MAX_PLAYER_NAME]; 
    GetPlayerName(playerid, playername, MAX_PLAYER_NAME); 
    return dini_Get(AddDirFile(dir_userfiles, playername), "Rank"); 
}



Re: strings help - GoldenLion - 03.03.2017

I'd like to add that you don't need the stock keyword there, have a look here: https://sampforum.blast.hk/showthread.php?tid=570635


Re: strings help - RyderX - 03.03.2017

Also try using y_ini instead of Dini


Re: strings help - GoldenLion - 03.03.2017

Quote:
Originally Posted by RyderX
Посмотреть сообщение
Also try using y_ini instead of Dini
Stop telling that to everyone. You know there's dini2 by Gammix.