SA-MP Forums Archive
random textdraws problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: random textdraws problem (/showthread.php?tid=112559)



random textdraws problem - a-day - 08.12.2009

hello everybody i want to make a random textdraw but i dindґt know how i can do this i have made together with a freind this code
but he dint work how it needs
it change one or 2 textdraws but then it stops can someone help me please

Code:
SetTimer("textdraw",10000,1);
Code:
public textdraw(playerid){
new gla=random(6)+1, s[100];
switch(gla) {
case 1: { s="~r~www.stuntlantis.de~w~ /teleports /jumps /dms /cars /commands1"; } 
case 2: { s="~r~www.stuntlantis.de~w~ /teleports /jumps /dms /cars /commands2"; } 
case 3: { s="~r~www.stuntlantis.de~w~ /teleports /jumps /dms /cars /commands3"; } 
case 4: { s="~r~www.stuntlantis.de~w~ /teleports /jumps /dms /cars /commands4"; } 
case 5: { s="~r~www.stuntlantis.de~w~ /teleports /jumps /dms /cars /commands5"; } 
case 6: { s="~r~www.stuntlantis.de~w~ /teleports /jumps /dms /cars /commands6"; }}
TextDrawSetString(www,s);

www = TextDrawCreate(10.000000,436.000000,s);
TextDrawSetShadow(www,0);
TextDrawSetOutline(www,1);
TextDrawBackgroundColor(www,0x000000FF);
TextDrawColor(www,0xFFFFFFFF);
TextDrawFont(www,3);
return 1;
}



Re: random textdraws problem - Joe Staff - 08.12.2009

this part of the code
pawn Code:
www = TextDrawCreate(10.000000,436.000000,s);
TextDrawSetShadow(www,0);
TextDrawSetOutline(www,1);
TextDrawBackgroundColor(www,0x000000FF);
TextDrawColor(www,0xFFFFFFFF);
TextDrawFont(www,3);
Needs to go into OnGameModeInit.



Re: random textdraws problem - a-day - 08.12.2009

iґve got this error

Code:
C:\Dokumente und Einstellungen\ante\Desktop\ls\S-L_Server\tester\gamemodes\stuntlantis.pwn(391) : error 017: undefined symbol "s"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
the line is

www = TextDrawCreate(10.000000,436.000000,s);

iґve put the code in ongamemode init but s isnt define there i have use

new s[100]; and compile but when i start the server it crashes so new s[100]; is wrong


Re: random textdraws problem - Jefff - 08.12.2009

U dont need s in OnGameModeInit
Code:
www = TextDrawCreate(10.000000,436.000000,"_");



Re: random textdraws problem - a-day - 08.12.2009

cool it works thank you


Re: random textdraws problem - a-day - 08.12.2009

sorry for this brake but now i have this problem i habe set the timer on 5 minuten so the textdraw is activate 5 minutes later how can i make that the random textdraw is activate when a player join

i have put

Code:
TextDrawShowForPlayer(playerid,Text:www);
in the onplayerconect public but it dosnt work how it needs


Re: random textdraws problem - Jay. - 20.06.2010

Quote:
Originally Posted by Antoni0
sorry for this brake but now i have this problem i habe set the timer on 5 minuten so the textdraw is activate 5 minutes later how can i make that the random textdraw is activate when a player join

i have put

Code:
TextDrawShowForPlayer(playerid,Text:www);
in the onplayerconect public but it dosnt work how it needs
It should be.


Code:
TextDrawShowForPlayer(playerid,www);