Clickable textdraw problems
#1

Sup guys after starting updating and working back on my gamemode ,
started to have trouble with TextDraws
so here are some codes
Yes those are clicable when You class request !
Quote:

public OnPlayerRequestClass(playerid, classid)
{

TextDrawShowForPlayer(playerid, Text:Lobby[0]);
TextDrawShowForPlayer(playerid, Text:Lobby[1]);
TextDrawShowForPlayer(playerid, Text:Lobby[2]);
TextDrawShowForPlayer(playerid, Text:Lobby[3]);
TextDrawShowForPlayer(playerid, Text:Lobby[4]);
TextDrawShowForPlayer(playerid, Text:Lobby[5]);
TextDrawShowForPlayer(playerid, Text:Lobby[6]);
TextDrawShowForPlayer(playerid, Text:Lobby[7]);
TextDrawShowForPlayer(playerid, Text:Lobby[8]);
TextDrawShowForPlayer(playerid, Text:Lobby[9]);
TextDrawShowForPlayer(playerid, Text:Lobby[10]);
SelectTextDraw(playerid, 0xA3B4C5FF);
//////////////////////////////////////////
SetPlayerPos(playerid, 661.6200,-820.1381,86.5092);
SetPlayerFacingAngle(playerid, 227.2857);
SetPlayerCameraLookAt(playerid, 661.6200,-820.1381,86.5092);
SetPlayerCameraPos(playerid, 673.1569,-826.9614,80.5580);
CreateObject(2780,658.29999,-814.70001,85.6,0.0,0.0,0.0);
RemoveBuildingForPlayer(playerid, 705, 658.20313, -818.14062, 85.13281, 0.0);
return 1;
}

Those when player spawns
Код HTML:
public OnPlayerSpawn(playerid)
{
	if(mode[playerid] == 1)
	{
	SetPlayerPos(playerid,3528.89990234,1239.19995117,30.20000076);
	SendClientMessage(playerid,-1,"Welcome to TDM Mode. Mode Cmds: /shop /kill /rules /cmds");
	GivePlayerWeapon(playerid,24,10000);
	GivePlayerWeapon(playerid,25,23242);
	GivePlayerWeapon(playerid,30,10000);
	GivePlayerWeapon(playerid,29,10000);
	GivePlayerWeapon(playerid,34,10000);
	SetPlayerArmour(playerid,50);
	}
	else if(mode[playerid] == 2)
	{
	SetPlayerPos(playerid,3362.1589355469,-2069.42578125,46.729736328125);
	SendClientMessage(playerid,-1,"Welcome to Stunt Mode. Mode Cmds: /nos /kill /rules /cmds");
	ShowPlayerDialog(playerid,DIALOG_STUNT, DIALOG_STYLE_LIST, "Stunt Cars", "Infernus\nBravura\nBuffalo\nMule\nCheetah\nVIP Turismo","Select", "");
	}
	return 1;
}
and those codes when u click the textdraw
Код:
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
	if(clickedid == Lobby[1]) //If player click DM textdraw
	{
	mode[playerid] = 1;
	PlayerInfo[playerid][pDM]++;
	SpawnPlayer(playerid);
	SetPlayerScore(playerid, PlayerInfo[playerid][pDMScore]);
  //SetPlayerPos(playerid, 1630.2030,-2328.9673,13.5469); //Pos
	}
	else if(clickedid == Lobby[3]) // If clicked STUNT
	{
  SetPlayerPos(playerid, -1424.6083, -290.9622, 14.1484); // Pos
	}
	else if(clickedid == Lobby[2]) //If click TDM !
	{
		SetPlayerPos(playerid, 1688.7990, 1447.7753, 10.7675); // Pos
	}
	else if(clickedid == Lobby[4])
	{
	
 	}
    TextDrawHideForPlayer(playerid, Text:Lobby[0]);
	TextDrawHideForPlayer(playerid, Text:Lobby[1]);
	TextDrawHideForPlayer(playerid, Text:Lobby[2]);
	TextDrawHideForPlayer(playerid, Text:Lobby[3]);
	TextDrawHideForPlayer(playerid, Text:Lobby[4]);
	TextDrawHideForPlayer(playerid, Text:Lobby[5]);
	TextDrawHideForPlayer(playerid, Text:Lobby[6]);
	TextDrawHideForPlayer(playerid, Text:Lobby[7]);
	TextDrawHideForPlayer(playerid, Text:Lobby[8]);
	TextDrawHideForPlayer(playerid, Text:Lobby[9]);
	TextDrawHideForPlayer(playerid, Text:Lobby[10]);
	CancelSelectTextDraw(playerid); // Everything worked out perfectly, now stop the player to be able to select shizzle.
	return 1;
}
so the problem its when i try to click First/ Second Textdraw Lobby 1 or lobby 2 it wont spawn the player where he selected
OnPlayerSpawn
there is what mode you pick etc etc
~ Sorry my bad english
hope anyone can help me
and yes its a mult gamemode
Reply
#2

Did u use this Function? https://sampwiki.blast.hk/wiki/TextDrawSetSelectable

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
if(
_:clickedid != INVALID_TEXT_DRAW)

    if(
clickedid ==  )
    { 
Reply
#3

TextDrawSetSelectable(Text:i, 1);
Yeah used it under OnPlayerRequestClass
but
player just spawns
and camera keeps on the Class selection
omfg :/
with old dialog style works fine
with TD won't work so good
EDIT: and yes the are clickable already
don't worry it just wont move the cam
like it froze on request
when i hit SPAWN button it spawn me randomly in LV .. i hate it . .
Reply
#4

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
if(
_:clickedid != INVALID_TEXT_DRAW)
    if(
clickedid == Lobby[1]) //If player click DM textdraw
    
{
    
mode[playerid] = 1;
        
SetPlayerPos(playerid, -1424.6083, -290.962214.1484); // Pos
        
SetPlayerInterior(playerid,);//Interior iD
        
SetPlayerFacingAngle(playerid,);//Facing Angle Comes From Pos.
        
SetCameraBehindPlayer(playerid);//Self Explain
        
TextDrawHideForPlayer(playeridText:Lobby[0]);
    
TextDrawHideForPlayer(playeridText:Lobby[1]);
    
TextDrawHideForPlayer(playeridText:Lobby[2]);
    
TextDrawHideForPlayer(playeridText:Lobby[3]);
    
TextDrawHideForPlayer(playeridText:Lobby[4]);
    
TextDrawHideForPlayer(playeridText:Lobby[5]);
    
TextDrawHideForPlayer(playeridText:Lobby[6]);
    
TextDrawHideForPlayer(playeridText:Lobby[7]);
    
TextDrawHideForPlayer(playeridText:Lobby[8]);
    
TextDrawHideForPlayer(playeridText:Lobby[9]);
    
TextDrawHideForPlayer(playeridText:Lobby[10]);
    }
    else if(
clickedid == Lobby[2]) // If clicked STUNT
    
{
        
SetPlayerPos(playerid, -1424.6083, -290.962214.1484); // Pos
        
SetPlayerInterior(playerid,);//Interior iD
        
SetPlayerFacingAngle(playerid,);//Facing Angle Comes From Pos.
        
SetCameraBehindPlayer(playerid);//Self Explain
        
TextDrawHideForPlayer(playeridText:Lobby[0]);
    
TextDrawHideForPlayer(playeridText:Lobby[1]);
    
TextDrawHideForPlayer(playeridText:Lobby[2]);
    
TextDrawHideForPlayer(playeridText:Lobby[3]);
    
TextDrawHideForPlayer(playeridText:Lobby[4]);
    
TextDrawHideForPlayer(playeridText:Lobby[5]);
    
TextDrawHideForPlayer(playeridText:Lobby[6]);
    
TextDrawHideForPlayer(playeridText:Lobby[7]);
    
TextDrawHideForPlayer(playeridText:Lobby[8]);
    
TextDrawHideForPlayer(playeridText:Lobby[9]);
    
TextDrawHideForPlayer(playeridText:Lobby[10]);
     }
    else if(
clickedid == Lobby[3]) //If click TDM !
    
{
    
SetPlayerPos(playerid, -1424.6083, -290.962214.1484); // Pos
        
SetPlayerInterior(playerid,);//Interior iD
        
SetPlayerFacingAngle(playerid,);//Facing Angle Comes From Pos.
        
SetCameraBehindPlayer(playerid);//Self Explain
        
TextDrawHideForPlayer(playeridText:Lobby[0]);
    
TextDrawHideForPlayer(playeridText:Lobby[1]);
    
TextDrawHideForPlayer(playeridText:Lobby[2]);
    
TextDrawHideForPlayer(playeridText:Lobby[3]);
    
TextDrawHideForPlayer(playeridText:Lobby[4]);
    
TextDrawHideForPlayer(playeridText:Lobby[5]);
    
TextDrawHideForPlayer(playeridText:Lobby[6]);
    
TextDrawHideForPlayer(playeridText:Lobby[7]);
    
TextDrawHideForPlayer(playeridText:Lobby[8]);
    
TextDrawHideForPlayer(playeridText:Lobby[9]);
    
TextDrawHideForPlayer(playeridText:Lobby[10]);
    }
    else if(
clickedid == Lobby[4])
    {
        
SetPlayerPos(playerid, -1424.6083, -290.962214.1484); // Pos
        
SetPlayerInterior(playerid,);//Interior iD
        
SetPlayerFacingAngle(playerid,);//Facing Angle Comes From Pos.
        
SetCameraBehindPlayer(playerid);//Self Explain
        
TextDrawHideForPlayer(playeridText:Lobby[0]);
    
TextDrawHideForPlayer(playeridText:Lobby[1]);
    
TextDrawHideForPlayer(playeridText:Lobby[2]);
    
TextDrawHideForPlayer(playeridText:Lobby[3]);
    
TextDrawHideForPlayer(playeridText:Lobby[4]);
    
TextDrawHideForPlayer(playeridText:Lobby[5]);
    
TextDrawHideForPlayer(playeridText:Lobby[6]);
    
TextDrawHideForPlayer(playeridText:Lobby[7]);
    
TextDrawHideForPlayer(playeridText:Lobby[8]);
    
TextDrawHideForPlayer(playeridText:Lobby[9]);
    
TextDrawHideForPlayer(playeridText:Lobby[10]);
    
CancelSelectTextDraw(playerid); 
    return 
1;

This Should Work. Just continue setting pos and stuff until lobby 10 and continue hiding the texts when a click clicks on each textdraw
Reply
#5

argh fixed used the wrong clickedid
omg
Used mode == 1; //Dm
on the TDM clickid xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)