SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 15/01/2011, 09:38 PM   #1
Baboon
High-roller
 
Baboon's Avatar
 
Join Date: Nov 2010
Location: The Netherlands
Posts: 1,594
Reputation: 315
Default Textdraws

So here is my main question: Why does it shows the changed (formatted) textdraw for everyone, but why not only for the player who has bought the weapon? How can I fix this?

Code:
public OnPlayerSelectedMenuRow(playerid, row)//shop
{
        TogglePlayerControllable(playerid,1);
	new Menu: Current = GetPlayerMenu(playerid);
	ShowMenuForPlayer(HIMenu,playerid);
	if(Current == HIMenu)
	{
		SetPlayerInterior(playerid,6);
		switch(row)
		{
			case 0:
      		        {
				if(GetPlayerMoney(playerid) >= 15000)//m4
				{
				        if(m4text[playerid] == 1)
					{
					    ShowMenuForPlayer(HIMenu,playerid);
						return SendClientMessage(playerid, WHITE, "you already bought this weapon...");
					}
					GivePlayerMoney(playerid, -15000);
					ShowMenuForPlayer(HIMenu,playerid);
					TogglePlayerControllable(playerid,0);
					m4text[playerid] = 1;
					ak74textspawn[playerid] = 0;
					if(ak74text[playerid] == 1)
					{
						ak74text[playerid] = 0;
					}
					if(mp5text[playerid] == 1)
					{
						mp5text[playerid] = 0;
					}
					if(shotguntext[playerid] == 1)
					{
						shotguntext[playerid] = 0;
					}
					SetPVarString(playerid,"currentprimary","M4A1");
    			        }
				else
				{
    				SendClientMessage(playerid, WHITE, "You don't have enough money.");
    				ShowMenuForPlayer(HIMenu,playerid);
					TogglePlayerControllable(playerid,0);
				}
   			}
Code:
public updateweapon()
{
	for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
	{
	    GetPVarString(playerid, "currentprimary", Primary, 25);
	    GetPVarString(playerid, "currentsecondary", Secondary, 25);
	    GetPVarString(playerid, "currentextra", Extra, 25);
	    TextDrawSetString(primary,Primary);
	    TextDrawSetString(secondary,Secondary);
	    TextDrawSetString(extra,Extra);
	}
	return 1;
}
the show is in the shop (at player spawn)....
changing public updateweapon() to public updateweapon(playerid) didn't helped either..
Any ideas to fix this? Is there some kind of TextDrawSetStringForPlayer ?? It is for my shop..
Baboon is offline  
Old 16/01/2011, 07:32 AM   #2
*IsBack
Huge Clucker
 
*IsBack's Avatar
 
Join Date: Dec 2010
Posts: 254
Reputation: 0
Default Re: Textdraws

I can't see TextDrawShowForPlayer anywhere in the script you posted.. :/
__________________
From now on, I'm on this account: SiJ
*IsBack is offline  
Old 16/01/2011, 10:35 AM   #3
Baboon
High-roller
 
Baboon's Avatar
 
Join Date: Nov 2010
Location: The Netherlands
Posts: 1,594
Reputation: 315
Default Re: Textdraws

Quote:
the show is in the shop (at player spawn)....
So under if(shop[playerid] == 1)
the show is there.

but I guess it is the TextDrawSetString, isnt there some kind of function that this only counts for one player?
Baboon 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
[HELP]TextDraws Box psoftware Help Archive 1 11/01/2011 08:49 PM
New to textdraws xD bartje01 Help Archive 3 17/07/2010 07:21 PM
[TEXTDRAWS] Textdraws mixed up KnooL Help Archive 22 23/06/2010 02:52 PM
Help, Textdraws jaksimaksi Help Archive 1 25/12/2009 07:04 PM
TextDraws patchkinson Help Archive 6 25/11/2009 06:49 PM


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


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