21.08.2012, 17:05
Hello today my friend mapped gate which I use like movement but to open that doors.You need to get to the checkpoint when you enter to check point Textdraw must show but to me textdraw don`t want to show! I don`t see problem but it`s dont want to show...
Code:
Here is full code of my gates...with textdraw and everything please help me!!
Code:
pawn Код:
new Text:Textdraw14;
new Text:Textdraw15;
new Text:Textdraw16;
new Text:Textdraw17;
new Text:Textdraw18;
new Text:Textdraw19;
new Text:Textdraw20;
new movegate;
new gate1;
new gate2;
new select[MAX_PLAYERS];
public OnGameModeInit()
{
Textdraw14 = TextDrawCreate(27.000000, 303.000000, "_");
TextDrawBackgroundColor(Textdraw14, 255);
TextDrawFont(Textdraw14, 1);
TextDrawLetterSize(Textdraw14, 0.500000, 3.099997);
TextDrawColor(Textdraw14, -1);
TextDrawSetOutline(Textdraw14, 0);
TextDrawSetProportional(Textdraw14, 1);
TextDrawSetShadow(Textdraw14, 1);
TextDrawUseBox(Textdraw14, 1);
TextDrawBoxColor(Textdraw14, 136);
TextDrawTextSize(Textdraw14, 147.000000, 0.000000);
Textdraw15 = TextDrawCreate(150.000000, 304.000000, "_");
TextDrawBackgroundColor(Textdraw15, 255);
TextDrawFont(Textdraw15, 1);
TextDrawLetterSize(Textdraw15, 0.500000, -0.600000);
TextDrawColor(Textdraw15, -1);
TextDrawSetOutline(Textdraw15, 0);
TextDrawSetProportional(Textdraw15, 1);
TextDrawSetShadow(Textdraw15, 1);
TextDrawUseBox(Textdraw15, 1);
TextDrawBoxColor(Textdraw15, 255);
TextDrawTextSize(Textdraw15, 24.000000, 0.000000);
Textdraw16 = TextDrawCreate(151.000000, 302.000000, "_");
TextDrawBackgroundColor(Textdraw16, 255);
TextDrawFont(Textdraw16, 1);
TextDrawLetterSize(Textdraw16, 0.500000, 3.400000);
TextDrawColor(Textdraw16, -1);
TextDrawSetOutline(Textdraw16, 0);
TextDrawSetProportional(Textdraw16, 1);
TextDrawSetShadow(Textdraw16, 1);
TextDrawUseBox(Textdraw16, 1);
TextDrawBoxColor(Textdraw16, 255);
TextDrawTextSize(Textdraw16, 147.000000, 0.000000);
Textdraw17 = TextDrawCreate(26.000000, 334.000000, "_");
TextDrawBackgroundColor(Textdraw17, 255);
TextDrawFont(Textdraw17, 1);
TextDrawLetterSize(Textdraw17, 0.500000, -0.100000);
TextDrawColor(Textdraw17, -1);
TextDrawSetOutline(Textdraw3, 0);
TextDrawSetProportional(Textdraw17, 1);
TextDrawSetShadow(Textdraw17, 1);
TextDrawUseBox(Textdraw17, 1);
TextDrawBoxColor(Textdraw17, 255);
TextDrawTextSize(Textdraw17, 148.000000, 0.000000);
Textdraw18 = TextDrawCreate(27.000000, 302.000000, "_");
TextDrawBackgroundColor(Textdraw18, 255);
TextDrawFont(Textdraw18, 1);
TextDrawLetterSize(Textdraw18, 0.500000, 3.500002);
TextDrawColor(Textdraw18, -1);
TextDrawSetOutline(Textdraw18, 0);
TextDrawSetProportional(Textdraw18, 1);
TextDrawSetShadow(Textdraw18, 1);
TextDrawUseBox(Textdraw18, 1);
TextDrawBoxColor(Textdraw18, 255);
TextDrawTextSize(Textdraw18, 23.000000, 0.000000);
Textdraw19 = TextDrawCreate(49.000000, 295.000000, "Gate Command");
TextDrawBackgroundColor(Textdraw19, 255);
TextDrawFont(Textdraw19, 3);
TextDrawLetterSize(Textdraw19, 0.300000, 1.000000);
TextDrawColor(Textdraw19, -1);
TextDrawSetOutline(Textdraw19, 1);
TextDrawSetProportional(Textdraw19, 1);
Textdraw20 = TextDrawCreate(50.000000, 314.000000, "Open");
TextDrawBackgroundColor(Textdraw20, 255);
TextDrawFont(Textdraw20, 2);
TextDrawLetterSize(Textdraw20, 0.629999, 1.000000);
TextDrawColor(Textdraw20, -1);
TextDrawSetOutline(Textdraw20, 1);
TextDrawSetProportional(Textdraw20, 1);
TextDrawUseBox(Textdraw20, 1);
TextDrawBoxColor(Textdraw20, 0x00000088);
TextDrawTextSize(Textdraw20, 119.000000, 10.000000);
gate1 = CreateObject(2929,1410.82397461,-1717.46984863,6.48719645,0.00000000,0.00000000,86.00000000); //zatvoreno(dovne) (1)
gate2 = CreateObject(2929,1410.82922363,-1717.45227051,9.96221256,0.00000000,0.00000000,85.99548340); //zatvoreno(horne) (3)
TextDrawSetSelectable(Text:Textdraw20, 1);
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
if(clickedid == Textdraw20)
{
MoveObject(gate1,1410.82397461,-1717.46984863,4.21218777,2.0);
MoveObject(gate2,1410.82922363,-1717.45227051,11.96218204,2.0);
SetTimer("gates",5000,0);
CancelSelectTextDraw(playerid);
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == movegate)
{
if(GetPlayerTeam(playerid) == 1) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR]"embed_white"You need to be Survivor to open this doors!");
{
if(UserStats[playerid][Exp] < 5000) return SendClientMessage(playerid,0xFFFFFFFF,""embed_red"[ERROR]"embed_white"You need to have 5000 Exp to open this doors!");
{
TextDrawShowForPlayer(playerid,Textdraw14);
TextDrawShowForPlayer(playerid,Textdraw15);
TextDrawShowForPlayer(playerid,Textdraw16);
TextDrawShowForPlayer(playerid,Textdraw17);
TextDrawShowForPlayer(playerid,Textdraw18);
TextDrawShowForPlayer(playerid,Textdraw19);
TextDrawShowForPlayer(playerid,Textdraw20);
select[playerid] = 1;
}
}
}
return 1;
}
forward gates();
public gates()
{
MoveObject(gate1,1410.82397461,-1717.46984863,6.48719645,2.0);
MoveObject(gate2,1410.82922363,-1717.45227051,9.96221256,2.0);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED( KEY_FIRE ))
{
if(select[playerid] == 1)
{
SelectTextDraw(playerid, 0x00FF00FF);
}
}
return 1;
}