SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

Thread Tools Display Modes
Old 29/05/2010, 07:02 PM   #1
Huge Clucker
Join Date: May 2010
Posts: 290
Reputation: 0
Default How to write something in a VAR?

How can i use, new text = "Hello" <--- I don't know how i can do this.

#include <a_samp>

I think it must here,
new text = "Hello" or Hello, i want to put a text in it.

public OnGameModeInit()
SendClientMessage(playerid, COLOR_RED, text);
return 1;
How can i do this, i'm really confused, i thought this is the same
as C++, but .. I'm very confused. So i want to put a text in
new text;
Ihsan_Cingisiz is offline  
Old 29/05/2010, 07:07 PM   #2
Big Clucker
Join Date: Feb 2010
Posts: 138
Reputation: 3
Default Re: How to write something in a VAR?

SendClientMessage(playerid, COLOR, "Hello");
IcyBlight is offline  
Old 29/05/2010, 07:21 PM   #3
MadeMan's Avatar
Join Date: Jun 2007
Posts: 3,488
Reputation: 256
Default Re: How to write something in a VAR?

You need to add the number of cells for characters

pawn Code:
new text[32] = "Hello";
MadeMan is offline  
Old 29/05/2010, 07:23 PM   #4
Huge Clucker
Join Date: Aug 2009
Posts: 215
Reputation: 0
Default Re: How to write something in a VAR?

Well you can define it to like:

pawn Code:
#define F_TEXT "Hello"

Julian2574 is offline  
Old 29/05/2010, 07:24 PM   #5
Join Date: Jan 2009
Posts: 6,129
Reputation: 1127
Default Re: How to write something in a VAR?

Or, simply:

pawn Code:
SendClientMessage(playerid, color, "Message here.");

However, if you need to use a variable in a string, then you'll need to create a string and format it:

pawn Code:
new String[6], lol = 6; // New variables are integers by default, you need to set a cell size.
format(String, sizeof(String), "hello%d", lol ); // lol is an integer with the value of 6. The message will be "hello6"
SendClientMessage(playerid, color, string); // Sending the string.
Calgon is offline  

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do You Write This? sidhu123 Everything and Nothing 2 12/09/2009 04:05 AM
Write something in big and to the top TimBuk.Ekh Help Archive 3 18/04/2009 07:19 PM

All times are GMT. The time now is 08:32 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.