14.01.2011, 12:47
TextdrawSetString?
14.01.2011, 12:52
"Please help me fix this, thank you"
14.01.2011, 12:53
pawn Код:
public OnPlayerConnect(playerid)
{
SetTimer("ShowWelcomeMessage",1000,true);
return 1;
}
public ShowWelcomeMessage(playerid)
{
WelcomeMessageStage ++;
if(WelcomeMessageStage == 1)
{
TextDrawSetString(WelcomeMessage,"Welcome to!");
}
else if(WelcomeMessageStage == 2)
{
TextDrawSetString(WelcomeMessage,"~g~K~w~Z~b~R");
}
else if(WelcomeMessageStage == 3)
{
TextDrawSetString(WelcomeMessage,"~h~Welcome ~h~to!");
}
else if(WelcomeMessageStage == 4)
{
TextDrawSetString(WelcomeMessage,"Kamikaze Racing");
}
else if(WelcomeMessageStage == 5)
{
TextDrawSetString(WelcomeMessage,"~h~Kamikaz~h~e ~h~Racing");
WelcomeMessageStage =0;
}
TextDrawShowForPlayer(playerid, WelcomeMessage);
return 1;
}
EDIT: I just fixed the code again
14.01.2011, 12:55
Quote:
pawn Код:
EDIT: I just fixed the code again |
hey warning on this line.
Tag mismatch TextDrawShowForPlayer(playerid,WelcomeMessageStage );
14.01.2011, 12:56
pawn Код:
TextDrawShowForPlayer(playerid, WelcomeMessage);
14.01.2011, 12:59
pawn Код:
new PlayerTimer[MAX_PLAYERS];
new PlayerWelcomeMessageState[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, WelcomeMessage);
PlayerTimer[playerid] = SetTimerEx("ShowWelcomeMessage", 1000, true, "d", playerid);
return 1;
}
public ShowWelcomeMessage(playerid)
{
PlayerWelcomeMessageState[playerid] ++;
switch(PlayerWelcomeMessageState[playerid])
{
case 1: TextDrawSetString(WelcomeMessage,"Welcome to!");
case 2: TextDrawSetString(WelcomeMessage,"~g~K~w~Z~b~R");
case 3: TextDrawSetString(WelcomeMessage,"~h~Welcome ~h~to!");
case 4: TextDrawSetString(WelcomeMessage,"Kamikaze Racing");
case 5: TextDrawSetString(WelcomeMessage,"~h~Kamikaz~h~e ~h~Racing");
case 6:
{
KillTimer(PlayerTimer[playerid]);
TextDrawHideForPlayer(playerid, WelcomeMessage);
}
}
return 1;
}
14.01.2011, 13:00
Quote:
pawn Код:
|
pawn Код:
new PlayerTimer[MAX_PLAYERS];
new PlayerWelcomeMessageState[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, WelcomeMessageStage);
PlayerTimer[playerid] = SetTimer("ShowWelcomeMessage", 1000, true, "d", playerid);
return 1;
}
public ShowWelcomeMessage(playerid)
{
PlayerWelcomeMessageState[playerid] ++;
switch(PlayerWelcomeMessageState[playerid])
{
case 1: TextDrawSetString(WelcomeMessage,"Welcome to!");
case 2: TextDrawSetString(WelcomeMessage,"~g~K~w~Z~b~R");
case 3: TextDrawSetString(WelcomeMessage,"~h~Welcome ~h~to!");
case 4: TextDrawSetString(WelcomeMessage,"Kamikaze Racing");
case 5: TextDrawSetString(WelcomeMessage,"~h~Kamikaz~h~e ~h~Racing");
case 6:
{
KillTimer(PlayerTimer[playerid]);
TextDrawShowForPlayer(playerid, WelcomeMessage);
}
}
return 1;
}
In this case he was editing WelcomeMessage Textdraw, but he tried to show WelcomeMessageStage textdraw
DVDK's method is faster, because use of switch()
14.01.2011, 13:01
Quote:
pawn Код:
In this case he was editing WelcomeMessage Textdraw, but he tried to show WelcomeMessageStage textdraw |
And he didn't end the timer, and the state also wasn't including any playerid.
14.01.2011, 13:03
The problem was there too, just didn't notice ,because i noticed only the WelcomeMessageStage and didnt notice rest of the code
Edit: You're wrong, you don't need any player id's there. Use my code above it's better, but you can convert it to switch too
Edit: You're wrong, you don't need any player id's there. Use my code above it's better, but you can convert it to switch too
« Next Oldest | Next Newest »
Users browsing this thread: 1 Guest(s)