SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 05/04/2010, 05:06 PM   #1
DarrenReeder
Huge Clucker
 
DarrenReeder's Avatar
 
Join Date: Apr 2010
Posts: 489
Reputation: 14
Default TextDraws as server variable?? How to i change to Player Variable?

Hello, i have created a /stats sort of thing on the side of the screen with textdraws. I would like to know how i make the textdraw's different for EVery player on the server. at the moment the textdraw is a 'server variable' (i think?) and when one person updates the textdraw, it updates for everyone...

They are set as this:

Code:
new Text:TextDraw;
although i would like it to be somthing like

Code:
new Text:TextDraw[MAX_PLAYERS];
but this gets errors....any help would be great, thankS!
DarrenReeder is offline  
Old 05/04/2010, 06:53 PM   #2
DarrenReeder
Huge Clucker
 
DarrenReeder's Avatar
 
Join Date: Apr 2010
Posts: 489
Reputation: 14
Default Re: TextDraws as server variable?? How to i change to Player Variable?

-bump-
DarrenReeder is offline  
Old 06/04/2010, 07:02 AM   #3
Babul
High-roller
 
Babul's Avatar
 
Join Date: Sep 2009
Location: in a cement block
Posts: 1,781
Reputation: 266
Default Re: TextDraws as server variable?? How to i change to Player Variable?

on top of script (not in any function, place it between or in front of them):
Code:
new Text:TDStatus[MAX_PLAYERS];
a string for a textdraw must not be initialised empty, so dont forget the "_":
Code:
public OnGameModeInit()
{
	for(new p=0;p<GetMaxPlayers();p++)
	{
		TDStatus[p]=TextDrawCreate(0,421,"_");
		TextDrawLetterSize(TDStatus[p],0.20,0.80);
		TextDrawFont(TDStatus[p],2);
		TextDrawSetProportional(TDStatus[p],0);
		TextDrawSetShadow(TDStatus[p],0);
		TextDrawSetOutline(TDStatus[p],1);
	}
}
to show it up, you 1st need to set a string into it with format(), then show it to the desired player:
Code:
	new TDString[256];//those strings can be very long
	format(TDString,sizeof(TDString),"~b~~h~~h~Title~n~~w~your playerID: %d~n~",playerid);
	TextDrawSetString(TDStatus[playerid],TDString);
	TextDrawShowForPlayer(playerid,TDStatus[playerid]);
	ShowTDStatus(playerid);
i hope i didnt forget something...
__________________
FireWorks

new sscanf2 custom specifiers available for Download, read the Release Topic
Babul 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
(19879) : warning 219: local variable "mod" shadows a variable at a preceding le ReactionGameServers Help Archive 4 02/03/2010 08:23 PM
local variable "KillsName" shadows a variable at a preceding level (weird) ғαιιοцт Help Archive 40 14/10/2009 07:04 PM
warning 219: local variable "timecounter" shadows a variable at a preceding leve PKRanger Help Archive 3 08/08/2009 04:04 PM
local variable "tmp2" shadows a variable at a preceding level Battlaman Help Archive 2 04/08/2009 06:10 PM
Strange variable/player file problem Byrner Help Archive 8 24/05/2009 11:25 PM


All times are GMT. The time now is 09:04 PM.


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