What's wrong in this ?
#1

Quote:

new drank[45];
if(PlayerInfo[playerid][pDonateRank] == 1) { drank = "[Bronze]"; }
if(PlayerInfo[playerid][pDonateRank] == 2) { drank = "[Silver]"; }
if(PlayerInfo[playerid][pDonateRank] == 3) { drank = "[Gold]"; }
if(PlayerInfo[playerid][pDonateRank] == 4) { drank = "[Platinum]"; }
if(PlayerInfo[playerid][pDonateRank] == 5) { drank = "[Moderator]"; }
if(PlayerInfo[playerid][pDonateRank] == 6) { drank = "[Admin]"; }
format(string, sizeof(string), "%s VIP %s: %s", drank, sendername, result, RemoveUnderScore(playerid));

Well , I already Defined : RemoveUnderScore(playerid)); - but when i try the chat it works but the UNDERSCORE don't get removed , any help ? +Rep for the one who will help
Reply
#2

I am Really Sorry for Bumping but it's Really Urgent and i need help
Reply
#3

I would suggest you use switch

switch(PlayerInfo[playerid][pDonateRank])
{
case 1: drank = "[Bronze]"
...
}

And can I see teh RemoveUnderScore ?
Reply
#4

Quote:

stock RemoveUnderScore(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
for(new i = 0; i < MAX_PLAYER_NAME; i++)
{
if(name[i] == '_') name[i] = ' ';
}
return name;
}

Here...
Reply
#5

Quote:
Originally Posted by Biesmen
Посмотреть сообщение
Search for the sign "_" in the string, then replace it with " ".
I found a code for you.
pawn Код:
GiveNameSpace(str[])
{
    new strl;
    strl=strlen(str);
    while(strl--) {
    if(str[strl]=='_')  str[strl]=' ';
    }
    return 0;
}
(PR-RP)


Usage:
pawn Код:
new string[4];
string = "R_L";
GiveNameSpace(string);
return string; // will return "R L"
For the name:
pawn Код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GiveNameSpace(playername);
return playername; // If your name was "Haha_Lol", it will return "Haha Lol".
p/s What? We have to wait 2 minutes, again, to post?
There.
Reply
#6

What's the Relation between that code and mine ? I just want to know what's wrong in mine lol
Reply
#7

Quote:
Originally Posted by Breto
Посмотреть сообщение
What's the Relation between that code and mine ? I just want to know what's wrong in mine lol
Compare em, open your eyes wide, and look at it closely.
Reply
#8

Quote:

Compare em, open your eyes wide, and look at it closely.

Really ? Really Helpfull answer - Thank you Very Very Very Much
Reply
#9

Wrong Post - Clicked 2 Times by wrong
Reply
#10

Quote:
Originally Posted by Breto
Посмотреть сообщение
Really ? Really Helpfull answer - Thank you Very Very Very Much
I neither can found a bug in yours.
Problem should be (in my opinion):
pawn Код:
format(string, sizeof(string), "%s VIP %s: %s", drank, sendername, result, RemoveUnderScore(playerid));
You request 3 strings (%s), and give 4 variables to format.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)