Teleport + MSG (+Rep)
#1

Hello everyone.
Im new at scripting and i wanted to make a fast teleport + msg.
This is how the codes look:
================================================== ==

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/LV") == 0)
{
SetPlayerPos(playerid, 2804.0972,1772.2668,10.8203);
SendClientMessage(playerid, COLOR_RED, "Welcome to Las Venturas)");
}
return 1;

}
========================
I get this error ''undefined symbol "COLOR_RED"
Reply
#2

At the top of script under the includes
Код:
#define COLOR_RED   0xFF0000AA
+Rep i would appreciate it
Reply
#3

Thanks, it helped.
Rep added
Reply
#4

Btw if i want my text like this
=================
Welcome to Las Venturas
=================
Have fun!

How to do it?
Reply
#5

Код:
SendClientMessage(playerid, COLOR_RED, "=================)");
SendClientMessage(playerid, COLOR_RED, "Welcome to Las Venturas)");
SendClientMessage(playerid, COLOR_RED, "=================)");
SendClientMessage(playerid, COLOR_RED, "Have fun!)");
And you can change colors..
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/LV") == 0)
{
SetPlayerPos(playerid, 2804.0972,1772.2668,10.8203);
SendClientMessage(playerid, COLOR_WHITE, "=================");
SendClientMessage(playerid, COLOR_RED, "Welcome to Las Venturas");
SendClientMessage(playerid, COLOR_WHITE, "=================");
SendClientMessage(playerid, COLOR_RED, "Have fun!");
}
return 1;
}
Reply
#7

Also, as new, you need to know that the colors in SendClientMessage() will not work if you didn't defined them.
You have to define every color with the name and its "color-code" (means the hex number, but I don't want to confuse you).

This could help:
pawn Код:
#define COLOR_GREEN 0x00FF00FF
#define COLOR_BLUE 0x0000FFFF
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_WHITE 0xFFFFFFFF
When you'll add this after your define of COLOR_RED, you'll have these four colors and you'll be able to use them in the script.
Reply
#8

http://pastebin.com/TAL3LSpd

copy these and paste them in the top of your script :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)