random textdraws problem
#1

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;
}
Reply
#2

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.
Reply
#3

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
Reply
#4

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

cool it works thank you
Reply
#6

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
Reply
#7

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);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)