SA-MP Forums Archive
Teleport + MSG (+Rep) - 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: Teleport + MSG (+Rep) (/showthread.php?tid=331942)



Teleport + MSG (+Rep) - iSplasH - 06.04.2012

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"


Re: Teleport + MSG (+Rep) - GtasaPoliceModz - 06.04.2012

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


Re: Teleport + MSG (+Rep) - iSplasH - 06.04.2012

Thanks, it helped.
Rep added


Re: Teleport + MSG (+Rep) - iSplasH - 06.04.2012

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

How to do it?


Re: Teleport + MSG (+Rep) - TzAkS. - 06.04.2012

Код:
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..


Re: Teleport + MSG (+Rep) - Faisal_khan - 06.04.2012

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;
}



Re: Teleport + MSG (+Rep) - Amit_B - 06.04.2012

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.


Re: Teleport + MSG (+Rep) - Allu - 06.04.2012

http://pastebin.com/TAL3LSpd

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