Textdraw
#1

When the mouse pointer be on edm it make red highlight on stunt and edm but when i order the mouse pointer to be on stunt it select stunt only so i need it to select edm only or stunt only codes

PHP код:
public OnGameModeInit()
{
TDEditor_TD[0] = TextDrawCreate(1.200059, -1.146733"_____~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~");
TextDrawLetterSize(TDEditor_TD[0], 0.4000001.600000);
TextDrawTextSize(TDEditor_TD[0], 636.0000000.000000);
TextDrawAlignment(TDEditor_TD[0], 1);
TextDrawColor(TDEditor_TD[0], -65347);
TextDrawUseBox(TDEditor_TD[0], 1);
TextDrawBoxColor(TDEditor_TD[0], 8593);
TextDrawSetShadow(TDEditor_TD[0], 0);
TextDrawSetOutline(TDEditor_TD[0], 0);
TextDrawBackgroundColor(TDEditor_TD[0], 5674141);
TextDrawFont(TDEditor_TD[0], 1);
TextDrawSetProportional(TDEditor_TD[0], 1);
TextDrawSetShadow(TDEditor_TD[0], 0);
TDEditor_TD[1] = TextDrawCreate(139.893157190.500122"~n~______Stunt~n~~n~");
TextDrawLetterSize(TDEditor_TD[1], 0.4023991.435732);
TextDrawAlignment(TDEditor_TD[1], 1);
TextDrawColor(TDEditor_TD[1], -1);
TextDrawSetShadow(TDEditor_TD[1], 0);
TextDrawSetOutline(TDEditor_TD[1], 0);
TextDrawBackgroundColor(TDEditor_TD[1], 255);
TextDrawFont(TDEditor_TD[1], 2);
TextDrawSetProportional(TDEditor_TD[1], 1);
TextDrawSetShadow(TDEditor_TD[1], 0);
TextDrawSetSelectable(TDEditor_TD[1], true);
TDEditor_TD[2] = TextDrawCreate(290.000000190.746673"____________________~n~______EDM~n~~n~");
TextDrawLetterSize(TDEditor_TD[2], 0.3887991.443199);
TextDrawAlignment(TDEditor_TD[2], 1);
TextDrawColor(TDEditor_TD[2], -50331649);
TextDrawSetShadow(TDEditor_TD[2], 0);
TextDrawSetOutline(TDEditor_TD[2], 0);
TextDrawBackgroundColor(TDEditor_TD[2], 255);
TextDrawFont(TDEditor_TD[2], 2);
TextDrawSetProportional(TDEditor_TD[2], 1);
TextDrawSetShadow(TDEditor_TD[2], 0);
TextDrawSetSelectable(TDEditor_TD[2], true);
TDEditor_TD[3] = TextDrawCreate(457.2000421.093325"NourX_Project_1.0.0");
TextDrawLetterSize(TDEditor_TD[3], 0.4000001.600000);
TextDrawAlignment(TDEditor_TD[3], 1);
TextDrawColor(TDEditor_TD[3], -1);
TextDrawSetShadow(TDEditor_TD[3], 0);
TextDrawSetOutline(TDEditor_TD[3], 0);
TextDrawBackgroundColor(TDEditor_TD[3], 255);
TextDrawFont(TDEditor_TD[3], 2);
TextDrawSetProportional(TDEditor_TD[3], 1);
TextDrawSetShadow(TDEditor_TD[3], 0);
    
TextDrawSetSelectable(TDEditor_TD[0], false);
TextDrawSetSelectable(TDEditor_TD[3], false);
    
SetGameModeText("NourX v1");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;

PHP код:
public OnPlayerConnect(playerid)
{
    
SendClientMessage(playeridCOLOR_MTA"Welcome to NourX RDM Server");
    new 
string[156], name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnamesizeof name);
    
format(stringsizeof string"%s has joined this server."name);
    
SendClientMessageToAll(COLOR_MTAstring);
    
TextDrawShowForPlayer(playerid,TDEditor_TD[0]);
    
TextDrawShowForPlayer(playerid,TDEditor_TD[1]);
    
TextDrawShowForPlayer(playerid,TDEditor_TD[2]);
    
TextDrawShowForPlayer(playerid,TDEditor_TD[3]);
    
SelectTextDraw(playerid0xFF0000FF);
    return 
1;

PHP код:
public OnPlayerClickTextDraw(playeridText:clickedid)
{
    if(
_:clickedid != INVALID_TEXT_DRAW// If the player clicked a valid textdraw, continue with the coding. (_:var removes the Text: tag, to avoid tag mismatch)
    
{
        if(
clickedid == TDEditor_TD[2])
        {
    
LoadText();
    
UMapTimer SetTimer("ServerData_UpdateMAP"800true);
    
SetTimer("ServerData_AlivePlayers"800true);
    if(
ServerData[Started] == true) {
    
SetPVarInt(playerid"Geberdi"1);
    if(
GetServerCount() > 1){
    
StartSpectate(playeridGetRandomPlayer(playerid));}
    }
    
SetPVarInt(playerid"Spawned"1);
    
TextDrawShowForPlayer(playeridMapText);
    
TextDrawShowForPlayer(playeridGecenSurem[playerid]);
    
TextDrawShowForPlayer(playeridSpectateYou[playerid]);
    
DisableRemoteVehicleCollisions(playeridtrue);
    
TogglePlayerSpectating(playeridfalse);
    
SpawnPlayer(playerid);
        }
        else if(
clickedid == TDEditor_TD[1])
        {
        
ShowPlayerDialog(playerid,2000,DIALOG_STYLE_MSGBOX,"Stunt/Freeroam","NourX Community.\nSorry, The Stunt/Freeroam mode is coming soon, Please rejoin the server and choose onther Mode.","Ok","");
        }
        
TextDrawHideForPlayer(playeridTDEditor_TD[0]);
        
TextDrawHideForPlayer(playeridTDEditor_TD[1]);
        
TextDrawHideForPlayer(playeridTDEditor_TD[2]);
        
TextDrawHideForPlayer(playeridTDEditor_TD[3]);
        
CancelSelectTextDraw(playerid); // This will indeed call OnPlayerClickTextDraw again, but with an ID of 65535. The code above stops it from resulting in an eternal loop.
    
}
    return 
1;

Reply
#2

Help?
Reply
#3

Help me!
Reply
#4

I think you need to set TextDrawTextSize for your clickable textdraws.
"This function defines the clickable area for use with TextDrawSetSelectable, whether a box is shown or not." - https://sampwiki.blast.hk/wiki/TextDrawTextSize
Reply
#5

Can you fix my codes?
Reply
#6

Код:
TextDrawTextSize(TDEditor_TD[1],X,Y);
TextDrawTextSize(TDEditor_TD[2],X,Y);
Where X and Y are coordinates relating to the center of the clickable stuff, such as the "EDM", or the "Stunt" portions. You'll need to plot them out, and refine them.

But really, what's it not doing?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)