This returns the Chat to clear. What's wrong? - 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: This returns the Chat to clear. What's wrong? (
/showthread.php?tid=303558)
This returns the Chat to clear. What's wrong? -
iGetty - 14.12.2011
pawn Код:
command(businesses, playerid, params[])
{
for(new i = 0; i < MAX_BUSINESSES; i++)
{
new string[1025];
format(string, sizeof(string), "%s", Businesses[i][bName]);
SendClientMessage(playerid, GREY, string);
}
return 1;
}
Re: This returns the Chat to clear. What's wrong? - suhrab_mujeeb - 14.12.2011
Because Businesses[i][bName] is assigned to nothing. And you do not make a string with the size 1025. I think the maximum that can be displayed is 128.
Re: This returns the Chat to clear. What's wrong? -
iGetty - 14.12.2011
What do you mean, assigned to nothing? & I know, I was meant to put 124.
Re: This returns the Chat to clear. What's wrong? - suhrab_mujeeb - 14.12.2011
Businesses[i][bName] = " "
So all you get is an empty chat.
Re: This returns the Chat to clear. What's wrong? -
Rob_Maate - 14.12.2011
You don't need to use format for copying the contents of one variable to another like that.
Just use x=y
Re: This returns the Chat to clear. What's wrong? -
Psymetrix - 14.12.2011
Delete.
Re: This returns the Chat to clear. What's wrong? -
Rob_Maate - 14.12.2011
If you have a blank variable and you want to fill it with the contents of another, there is no reason you can't use x=y.
Re: This returns the Chat to clear. What's wrong? -
Psymetrix - 14.12.2011
Apologies to Rob_Maate, I posted without thinking.
Edit: I meant to press edit.. Todays going great so far
Re: This returns the Chat to clear. What's wrong? -
Rob_Maate - 14.12.2011
xDDDD