Hallo!
Ich habe einen kleinen Bug, wenn ich versuche eine Text Draw Selection zu erstellen.
Ich werde einen Screen anhängen, dieser Zeigt eines meiner Beispiele. Wenn ich auf "Auswaehlen" klicke, passiert das, was passieren sollte, wenn ich auf den nach Links zeigenden Pfeil klicke.
Ich verstehe einfach nicht warum, ich Füge ebenfalls den Code ein.
stock CreateSkinSelectTD()
{
for(new playerid = 0; playerid < MAX_PLAYERS; playerid++){
CancelSelectTextDraw(playerid);
SkinSelect[playerid] = TextDrawCreate(274.000000, 377.000000, "Auswaehlen");
TextDrawBackgroundColor(SkinSelect[playerid], 255);
TextDrawFont(SkinSelect[playerid], 2);
TextDrawLetterSize(SkinSelect[playerid], 0.300000, 2.000000);
TextDrawColor(SkinSelect[playerid], -1);
TextDrawSetOutline(SkinSelect[playerid], 0);
TextDrawSetProportional(SkinSelect[playerid], 1);
TextDrawSetShadow(SkinSelect[playerid], 1);
TextDrawSetSelectable(SkinSelect[playerid], 1);
ArrowSkin1[playerid] = TextDrawCreate(250.000000, 371.000000, "~<~");
TextDrawBackgroundColor(ArrowSkin1[playerid], 255);
TextDrawFont(ArrowSkin1[playerid], 1);
TextDrawLetterSize(ArrowSkin1[playerid], 1.000000, 3.000000);
TextDrawColor(ArrowSkin1[playerid], -1);
TextDrawSetOutline(ArrowSkin1[playerid], 0);
TextDrawSetProportional(ArrowSkin1[playerid], 1);
TextDrawSetShadow(ArrowSkin1[playerid], 1);
TextDrawSetSelectable(ArrowSkin1[playerid], 1);
ArrowSkin2[playerid] = TextDrawCreate(362.000000, 371.000000, "~>~");
TextDrawBackgroundColor(ArrowSkin2[playerid], 255);
TextDrawFont(ArrowSkin2[playerid], 1);
TextDrawLetterSize(ArrowSkin2[playerid], 1.000000, 3.000000);
TextDrawColor(ArrowSkin2[playerid], -1);
TextDrawSetOutline(ArrowSkin2[playerid], 0);
TextDrawSetProportional(ArrowSkin2[playerid], 1);
TextDrawSetShadow(ArrowSkin2[playerid], 1);
TextDrawSetSelectable(ArrowSkin2[playerid], 1);
}
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid==ArrowSkin1[playerid])
{
if(SelectedSkin[playerid] < 0)
{
SelectedSkin[playerid]++;
}
SelectedSkin[playerid]--;
if(sInfo[playerid][geschlecht] == 1)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 1);
Skin[playerid] = 1;
}
case 1:
{
SetPlayerSkin(playerid, 2);
Skin[playerid] = 2;
}
case 2:
{
SetPlayerSkin(playerid, 3);
Skin[playerid] = 3;
}
case 3:
{
SetPlayerSkin(playerid, 4);
Skin[playerid] = 4;
}
case 4:
{
SetPlayerSkin(playerid, 6);
Skin[playerid] = 6;
}
}
}
if(sInfo[playerid][geschlecht] == 2)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 9);
Skin[playerid] = 9;
}
case 1:
{
SetPlayerSkin(playerid, 11);
Skin[playerid] = 11;
}
case 2:
{
SetPlayerSkin(playerid, 12);
Skin[playerid] = 12;
}
case 3:
{
SetPlayerSkin(playerid, 41);
Skin[playerid] = 41;
}
case 4:
{
SetPlayerSkin(playerid, 233);
Skin[playerid] = 233;
}
}
}
}
if(clickedid==ArrowSkin2[playerid])
{
if(SelectedSkin[playerid] > 4)
{
SelectedSkin[playerid]--;
}
SelectedSkin[playerid]++;
if(sInfo[playerid][geschlecht] == 1)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 1);
Skin[playerid] = 1;
}
case 1:
{
SetPlayerSkin(playerid, 2);
Skin[playerid] = 2;
}
case 2:
{
SetPlayerSkin(playerid, 3);
Skin[playerid] = 3;
}
case 3:
{
SetPlayerSkin(playerid, 4);
Skin[playerid] = 4;
}
case 4:
{
SetPlayerSkin(playerid, 6);
Skin[playerid] = 6;
}
}
}
if(sInfo[playerid][geschlecht] == 2)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 9);
Skin[playerid] = 9;
}
case 1:
{
SetPlayerSkin(playerid, 11);
Skin[playerid] = 11;
}
case 2:
{
SetPlayerSkin(playerid, 12);
Skin[playerid] = 12;
}
case 3:
{
SetPlayerSkin(playerid, 41);
Skin[playerid] = 41;
}
case 4:
{
SetPlayerSkin(playerid, 233);
Skin[playerid] = 233;
}
}
}
}
if(clickedid==SkinSelect[playerid])
{
if(SkinAuswahl[playerid] == 0) return 0;
TextDrawHideForPlayer(playerid, ArrowSkin1[playerid]);
TextDrawHideForPlayer(playerid, ArrowSkin2[playerid]);
TextDrawHideForPlayer(playerid, SkinSelect[playerid]);
SetPlayerVirtualWorld(playerid, 0);
if(sInfo[playerid][tutorial] == 0)
{
sInfo[playerid][tutorial]=1;
ShowPlayerDialog(playerid, DIALOG_REGINFO, DIALOG_STYLE_MSGBOX, ""cBlue"["SERVERTAG"]"cWhite" Willkommen!", ""cWhite" Willkommen auf "SERVERNAME"!\nDu erhälst von uns als Willkommensgeschenk:\n"cBlue"Ein Handy\n"cBlue"5000€\n"cBlue"Einen Personalausweis\n\n\n"cWhite"(Vituelle Gegenstände)", "Yay!", "");
CancelSelectTextDraw(playerid);
CancelSelectTextDraw(playerid);
}
SetPlayerSkin(playerid,Skin[playerid]);
sInfo[playerid][skin] = Skin[playerid];
SpawnPlayer(playerid);
ShowPlayerMoneyTextdraw(playerid);
SkinAuswahl[playerid] = 0;
}
return 1;
}
{
if(clickedid==ArrowSkin1[playerid])
{
if(SelectedSkin[playerid] < 0)
{
SelectedSkin[playerid]++;
}
SelectedSkin[playerid]--;
if(sInfo[playerid][geschlecht] == 1)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 1);
Skin[playerid] = 1;
}
case 1:
{
SetPlayerSkin(playerid, 2);
Skin[playerid] = 2;
}
case 2:
{
SetPlayerSkin(playerid, 3);
Skin[playerid] = 3;
}
case 3:
{
SetPlayerSkin(playerid, 4);
Skin[playerid] = 4;
}
case 4:
{
SetPlayerSkin(playerid, 6);
Skin[playerid] = 6;
}
}
}
if(sInfo[playerid][geschlecht] == 2)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 9);
Skin[playerid] = 9;
}
case 1:
{
SetPlayerSkin(playerid, 11);
Skin[playerid] = 11;
}
case 2:
{
SetPlayerSkin(playerid, 12);
Skin[playerid] = 12;
}
case 3:
{
SetPlayerSkin(playerid, 41);
Skin[playerid] = 41;
}
case 4:
{
SetPlayerSkin(playerid, 233);
Skin[playerid] = 233;
}
}
}
}
if(clickedid==ArrowSkin2[playerid])
{
if(SelectedSkin[playerid] > 4)
{
SelectedSkin[playerid]--;
}
SelectedSkin[playerid]++;
if(sInfo[playerid][geschlecht] == 1)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 1);
Skin[playerid] = 1;
}
case 1:
{
SetPlayerSkin(playerid, 2);
Skin[playerid] = 2;
}
case 2:
{
SetPlayerSkin(playerid, 3);
Skin[playerid] = 3;
}
case 3:
{
SetPlayerSkin(playerid, 4);
Skin[playerid] = 4;
}
case 4:
{
SetPlayerSkin(playerid, 6);
Skin[playerid] = 6;
}
}
}
if(sInfo[playerid][geschlecht] == 2)
{
switch(SelectedSkin[playerid])
{
case 0:
{
SetPlayerSkin(playerid, 9);
Skin[playerid] = 9;
}
case 1:
{
SetPlayerSkin(playerid, 11);
Skin[playerid] = 11;
}
case 2:
{
SetPlayerSkin(playerid, 12);
Skin[playerid] = 12;
}
case 3:
{
SetPlayerSkin(playerid, 41);
Skin[playerid] = 41;
}
case 4:
{
SetPlayerSkin(playerid, 233);
Skin[playerid] = 233;
}
}
}
}
if(clickedid==SkinSelect[playerid])
{
if(SkinAuswahl[playerid] == 0) return 0;
TextDrawHideForPlayer(playerid, ArrowSkin1[playerid]);
TextDrawHideForPlayer(playerid, ArrowSkin2[playerid]);
TextDrawHideForPlayer(playerid, SkinSelect[playerid]);
SetPlayerVirtualWorld(playerid, 0);
if(sInfo[playerid][tutorial] == 0)
{
sInfo[playerid][tutorial]=1;
ShowPlayerDialog(playerid, DIALOG_REGINFO, DIALOG_STYLE_MSGBOX, ""cBlue"["SERVERTAG"]"cWhite" Willkommen!", ""cWhite" Willkommen auf "SERVERNAME"!\nDu erhälst von uns als Willkommensgeschenk:\n"cBlue"Ein Handy\n"cBlue"5000€\n"cBlue"Einen Personalausweis\n\n\n"cWhite"(Vituelle Gegenstände)", "Yay!", "");
CancelSelectTextDraw(playerid);
CancelSelectTextDraw(playerid);
}
SetPlayerSkin(playerid,Skin[playerid]);
sInfo[playerid][skin] = Skin[playerid];
SpawnPlayer(playerid);
ShowPlayerMoneyTextdraw(playerid);
SkinAuswahl[playerid] = 0;
}
return 1;
}
MfG!