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
Ihsan_Cingisiz
Huge Clucker
 
Join Date: May 2010
Posts: 291
Reputation: 0
Default How to write something in a VAR?

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

Quote:
#include <a_samp>

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

main()
Quote:
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;
Thanks
Ihsan_Cingisiz is offline  
Old 29/05/2010, 07:07 PM   #2
IcyBlight
Big Clucker
 
Join Date: Feb 2010
Posts: 142
Reputation: 0
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
High-roller
 
MadeMan's Avatar
 
Join Date: Jun 2007
Posts: 3,472
Reputation: 237
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
Julian2574
Huge Clucker
 
Join Date: Aug 2009
Posts: 258
Reputation: 0
Default Re: How to write something in a VAR?

Well you can define it to like:

pawn Code:
#define F_TEXT "Hello"

SendClientMessage(playerid,COLOR_RED,F_TEXT);
Julian2574 is offline  
Old 29/05/2010, 07:24 PM   #5
Calgon
Godfather
 
Join Date: Jan 2009
Posts: 6,201
Reputation: 832
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.
__________________
If you don't know then Don't post here.

Quote:
(10:27:18 PM) dugi: hello is this the police?
(10:27:25 PM) dugi: Calgon is being mean
(10:27:31 PM) dugi: arrest him pls
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
[Tutorial] How to write a tutorial Y_Less Tutorials 32 16/05/2014 06:20 AM
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 09:49 PM.


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