strings help
#1

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;

Reply
#2

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

it sended me my name not my rank
Reply
#4

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

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

Also try using y_ini instead of Dini
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)