SA-MP Forums Archive
Need Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Help (/showthread.php?tid=358732)



Need Help - Eiy Mard - 11.07.2012

PHP код:
hey i need help .. i dont know what to call that lolz... i want make 3 or more .. but cant .. can some help me ?
This you will know what i mean :
new 
Text:txtTimeDisp;
new 
timestr[32];
             
public 
OnGameModeInit()
{         
TextDrawSetString(txtTimeDisp,timestr);
txtTimeDisp TextDrawCreate(600.0,25.0,"SRC");
TextDrawUseBox(txtTimeDisp0);
TextDrawFont(txtTimeDisp2);
TextDrawSetShadow(txtTimeDisp,1); 
TextDrawSetOutline(txtTimeDisp,1); 
TextDrawBackgroundColor(txtTimeDisp,gray);
TextDrawColor(txtTimeDisp,black);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.9,1.5);
txtTimeDisp TextDrawCreate(634.000000435.000000,"www.src-community.com");
TextDrawUseBox(txtTimeDisp0);
TextDrawFont(txtTimeDisp2);
TextDrawSetShadow(txtTimeDisp,1); 
TextDrawSetOutline(txtTimeDisp,1); 
TextDrawBackgroundColor(txtTimeDisp,gray);
TextDrawColor(txtTimeDisp,black);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.5000001.000000);
return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
return 
1;




Re: Need Help - clarencecuzz - 11.07.2012

pawn Код:
new Text:txtTimeDisp;
new Text:txtTimeDisp2;
new timestr[32];
             
public OnGameModeInit()
{        
TextDrawSetString(txtTimeDisp,timestr);
txtTimeDisp = TextDrawCreate(600.0,25.0,"SRC");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp,1);
TextDrawSetOutline(txtTimeDisp,1);
TextDrawBackgroundColor(txtTimeDisp,gray);
TextDrawColor(txtTimeDisp,black);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.9,1.5);
txtTimeDisp2 = TextDrawCreate(634.000000, 435.000000,"www.src-community.com");
TextDrawUseBox(txtTimeDisp2,0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp2,1);
TextDrawSetOutline(txtTimeDisp2,1);
TextDrawBackgroundColor(txtTimeDisp2,gray);
TextDrawColor(txtTimeDisp2,black);
TextDrawAlignment(txtTimeDisp2,3);
TextDrawLetterSize(txtTimeDisp2,0.500000, 1.000000);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtTimeDisp2);
return 1;
}
NOTE: Your textdraws will disappear forever once the player dies.


Re: Need Help - Eiy Mard - 11.07.2012

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
new Text:txtTimeDisp;
new Text:txtTimeDisp2;
new timestr[32];
             
public OnGameModeInit()
{        
TextDrawSetString(txtTimeDisp,timestr);
txtTimeDisp = TextDrawCreate(600.0,25.0,"SRC");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp,1);
TextDrawSetOutline(txtTimeDisp,1);
TextDrawBackgroundColor(txtTimeDisp,gray);
TextDrawColor(txtTimeDisp,black);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.9,1.5);
txtTimeDisp2 = TextDrawCreate(634.000000, 435.000000,"www.src-community.com");
TextDrawUseBox(txtTimeDisp2,0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp2,1);
TextDrawSetOutline(txtTimeDisp2,1);
TextDrawBackgroundColor(txtTimeDisp2,gray);
TextDrawColor(txtTimeDisp2,black);
TextDrawAlignment(txtTimeDisp2,3);
TextDrawLetterSize(txtTimeDisp2,0.500000, 1.000000);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtTimeDisp2);
return 1;
}
NOTE: Your textdraws will disappear forever once the player dies.
lolz .. that's not will happen .. i dont mean the OnPlayerDeath .. what i mean the textdraw .. not showing SRC .. the textdraw will show "www.src-community.com" only you know .. if you dont know what i mean .. put this to your GM


Re: Need Help - Eiy Mard - 11.07.2012

please help me lolz ..


Re: Need Help - clarencecuzz - 11.07.2012

Have you tested my code?


Re: Need Help - Eiy Mard - 12.07.2012

lolz .. sorry .. i didnt see txtTimeDisp2 .. haha .. sorry .. repp++ for you man .. but its not show textdraw ..


Re: Need Help - clarencecuzz - 12.07.2012

I think it might be in this area:
pawn Код:
TextDrawSetString(txtTimeDisp,timestr);
txtTimeDisp = TextDrawCreate(600.0,25.0,"SRC");
Notice how TextDrawSetString is happening before you have even created the textdraw?
Try replacing it with this:
pawn Код:
txtTimeDisp = TextDrawCreate(600.0,25.0,"SRC");
TextDrawSetString(txtTimeDisp,timestr);
EDIT: Sorry noticed a few errors in the last script I posted. The full code should look something like this:
pawn Код:
new Text:txtTimeDisp;
new Text:txtTimeDisp2;
new timestr[32];
             
public OnGameModeInit()
{        
txtTimeDisp = TextDrawCreate(600.0,25.0,"SRC");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp,1);
TextDrawSetOutline(txtTimeDisp,1);
TextDrawBackgroundColor(txtTimeDisp,gray);
TextDrawColor(txtTimeDisp,black);
TextDrawAlignment(txtTimeDisp,3);
TextDrawSetString(txtTimeDisp,timestr);
TextDrawLetterSize(txtTimeDisp,0.9,1.5);
txtTimeDisp2 = TextDrawCreate(634.000000, 435.000000,"www.src-community.com");
TextDrawUseBox(txtTimeDisp2,0);
TextDrawFont(txtTimeDisp2, 2);
TextDrawSetShadow(txtTimeDisp2,1);
TextDrawSetOutline(txtTimeDisp2,1);
TextDrawBackgroundColor(txtTimeDisp2,gray);
TextDrawColor(txtTimeDisp2,black);
TextDrawAlignment(txtTimeDisp2,3);
TextDrawLetterSize(txtTimeDisp2,0.500000, 1.000000);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtTimeDisp2);
return 1;
}



Re: Need Help - Eiy Mard - 12.07.2012

not working too ...


Re: Need Help - clarencecuzz - 12.07.2012

I don't have a lot of experience with textdraws so I probably won't be able to help you as much as some other users might be able to. Sorry :S


Re: Need Help - Littlehelper - 12.07.2012

Quote:
Originally Posted by clarencecuzz
Посмотреть сообщение
pawn Код:
new Text:txtTimeDisp;
new Text:txtTimeDisp2;
new timestr[32];
             
public OnGameModeInit()
{        
TextDrawSetString(txtTimeDisp,timestr);
txtTimeDisp = TextDrawCreate(600.0,25.0,"SRC");
TextDrawUseBox(txtTimeDisp, 0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp,1);
TextDrawSetOutline(txtTimeDisp,1);
TextDrawBackgroundColor(txtTimeDisp,gray);
TextDrawColor(txtTimeDisp,black);
TextDrawAlignment(txtTimeDisp,3);
TextDrawLetterSize(txtTimeDisp,0.9,1.5);
txtTimeDisp2 = TextDrawCreate(634.000000, 435.000000,"www.src-community.com");
TextDrawUseBox(txtTimeDisp2,0);
TextDrawFont(txtTimeDisp, 2);
TextDrawSetShadow(txtTimeDisp2,1);
TextDrawSetOutline(txtTimeDisp2,1);
TextDrawBackgroundColor(txtTimeDisp2,gray);
TextDrawColor(txtTimeDisp2,black);
TextDrawAlignment(txtTimeDisp2,3);
TextDrawLetterSize(txtTimeDisp2,0.500000, 1.000000);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid,txtTimeDisp);
TextDrawHideForPlayer(playerid,txtTimeDisp2);
return 1;
}
NOTE: Your textdraws will disappear forever once the player dies.
In the first place, how will the textdraws appear when there is nothing used to show them?
OT: Use
pawn Код:
TextDrawShowForPlayer(playerid,txtTimeDisp);
TextDrawShowForPlayer(playerid,txtTimeDisp2);
EDIT: late...