String -
JoeDaDude - 14.04.2009
Does someone know how to fix this,
This is my code:
[pawn] if (strcmp(cmdtext, "/helpls", true)==0)
{
new string[128];
format(string,sizeof(string),"%s Is Requesting Support At LS.");
SendClientMessageToAll(0xFF0000,string);
return 1;
}
[pawn]
In-game This Says: jlefgmnos ---------------------------- Is Requesting Support At LS
Its supposed to say: Torran Is Requesting Support At LS
Does anyone know how to stop this saying:
jlefgmnos ---------------------------- Is Requesting Support At LS
And start saying:
[playername] Is Requesting Support At LS,
[playername] is the players name from whoever said it,
Example if a guy named michael typed /helpls
It would say Michael is requesting support at ls,
Although if someone called torran typed /helpls
It would say Torran is requesting support at ls,
Any help will be good, Ty
Re: String -
[IB]Scorcher - 14.04.2009
pawn Код:
format(string,sizeof(string),"%s Is Requesting Support At LS.", sendername);
Re: String -
SpiderPork - 14.04.2009
Also, use GetPlayerName.
Re: String -
JoeDaDude - 14.04.2009
I get undefined symbol sendername,
If i define it i got alot more errors,
Any suggestions.
Re: String -
[IB]Scorcher - 14.04.2009
pawn Код:
if (strcmp(cmdtext, "/helpls", true)==0)
{
new string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string),"%s Is Requesting Support At LS.", sendername);
SendClientMessageToAll(0xFF0000,string);
return 1;
}
Re: String -
MenaceX^ - 14.04.2009
And if he doesn't have 'sendername' defined?..
Also better to make a global string, instead of make a string in each public.
I rather do something like
new string[1024];
in top of script, instead of
new string[128]; in each public.
If sendername isn't defined for you, add this.