How to make string ?
#1

Hello, I need to make in my server when someone talk can talk long example

Test: Hello , my name is Test and i m playing samp , I'm 16 Old , from israel

Not as this

Test: Hello , my name is Test and i m playing
samp , I'm 16 Old , from israel



---------> I dont know what this is called but i think it's will be in OnPlayerText string[DONTKNOWXD]
Reply
#2

String is a flexible piece of rope or twine which is used to tie, bind, or hang other objects.
Examples of string use include:

In musical instruments (see below)
Bow string, for propelling an arrow
Drawstring
Kite
Pullstring
String art
String bag
String bondage
String figure, design formed by weaving string around one's fingers
Stampede string, a long string usually


To make them, simply tie two or more ropes/twines together.
Reply
#3

Can u give me the script , maybe will be :
String[128];?
Reply
#4

Quote:
Originally Posted by [M.A]Angel[M.A]
Посмотреть сообщение
Hello, I need to make in my server when someone talk can talk long example

Test: Hello , my name is Test and i m playing samp , I'm 16 Old , from israel

Not as this

Test: Hello , my name is Test and i m playing
samp , I'm 16 Old , from israel



---------> I dont know what this is called but i think it's will be in OnPlayerText string[DONTKNOWXD]
Are you trying to make it go global or just nearby players?
Reply
#5

pawn Код:
new string[128];
new float:x, float:y, float:z;
GetPlayerPos(playerid, x, y, z);
new name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string),"%s Says: %s", name, text);
foreach(Player, i)
{
    if(IsPlayerInRangeOfPoint(i, 15, x, y, z)) SendClientMessage(i, 0x0000FF, string);
}
return 0;
Add on OnPlayerText
Reply
#6

Another qus , if i added the ID before that name so i will be [ID:0]Test: %s , i will got error this is right? i will got black color when someone talk or white , not all the colors
Reply
#7

I don't get it.
Reply
#8

This is how you'd add an ID to the thing as-well if thats what you are looking for:

pawn Код:
new string[128];
new float:x, float:y, float:z;
GetPlayerPos(playerid, x, y, z);
new name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string),"[ID:%i]%s Says: %s", playerid, name, text);
foreach(Player, i)
{
    if(IsPlayerInRangeOfPoint(i, 15, x, y, z)) SendClientMessage(i, 0x0000FF, string);
}
return 0;
Since you want the players ID, it needs to be an integer, therefore the %i is needed (or %d)
Reply
#9

U added an white color ? cant add all the colors?
Reply
#10

You should define colors at the top of your script like this:
Get an html color code, and do this:

pawn Код:
COLOR_WHITE FFFFFF
Of course, this is not the thing I want to do, seeing as it is not in the correct format. Simply do this to change it.

pawn Код:
COLOR_WHITE 0xFFFFFFFF
See what I added? I added the 0x in front of it as-well as two more letters at the end. The last two are for alpha, of which you can change to a number for the alpha if needed.

Then, when you want to use the color, simply do something like this

pawn Код:
SendClientMessage(playerid, COLOR_WHITE, "Sends this color in white");
So it will look like this:

Sends this color in white
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)