Random Money Amount Into String?
#1

How can i get the random amount to show in a string so i can use with SendClientMessage?

pawn Код:
randmoney = random(MAX_CASH);
                    GivePlayerMoney(playerid,randmoney);
eg. You have won $%i !!!

Any help?

Thanks in advanced!
Reply
#2

Use a format mate.

Код:
new string[256];
format(string, sizeof(string), "You have won $%d!", randmoney);
SendClientMessage(playerid, COLOR_HERE, string);
Reply
#3

Thanks
Reply
#4

Quote:
Originally Posted by Hoborific
Посмотреть сообщение
Just a helpful tip, you shouldn't need bigger than 128 string as thats the max characters of a sa-mp client message.
Yeah that is true, my mistake.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)