Hallo!
Ich versuche einen kleinen Screen Fader zu scripten, wenn ein Spieler stirbt, habe aber ein paar kleinere Problemchen.
Die Errors stehen ganz unten.
Erstellung der Textdraws
new PlayerText:DeathFadeTD[MAX_PLAYERS];
DeathFadeTD[playerid] = CreatePlayerTextDraw(playerid, -7.000000, 0.000000, "samaps:map");
PlayerTextDrawLetterSize(playerid, DeathFadeTD[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF0000C8);
PlayerTextDrawSetOutline(playerid, DeathFadeTD[playerid], 0);
PlayerTextDrawSetProportional(playerid, DeathFadeTD[playerid], 1);
PlayerTextDrawSetShadow(playerid, DeathFadeTD[playerid], 1);
PlayerTextDrawUseBox(playerid, DeathFadeTD[playerid], 1);
PlayerTextDrawBoxColor(playerid, DeathFadeTD[playerid], 0xFF0000C8);
PlayerTextDrawTextSize(playerid, DeathFadeTD[playerid], 650.000000, 450.000000);
Callbacks
new DeathFadeTimer[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawShowForPlayer(playerid, DeathFade[playerid]);
DeathFaderTimer[playerid] = SetTimerEx("DeathFader", 500/20, true, "i", playerid);
}
forward DeathFader(playerid);
public DeathFader(playerid)
{
new state; //Zeile 35
state++; //Zeile 36
switch(state) //Zeile 37
{
case 1: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF0000BE);
case 2: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF0000B4);
case 3: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF0000AA);
case 4: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF0000A0);
case 5: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000096);
case 6: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF00008C);
case 7: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000082);
case 8: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000078);
case 9: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF00006E);
case 10: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000064);
case 11: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF00005A);
case 12: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000050);
case 13: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000046);
case 14: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF00003C);
case 15: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000032);
case 16: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000028);
case 17: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF00001E);
case 18: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF000014);
case 19: PlayerTextDrawColor(playerid, DeathFadeTD[playerid], 0xFF00000A);
case 20:
{
PlayerTextDrawShow(playerid, DeathFadeTD[playerid]);
KillTimer(DeathFader[playerid]);
}
}
return 1;
}
Errors
Timer.inc(35) : error 001: expected token: "-identifier-", but found "state"
Timer.inc(36) : error 001: expected token: "-identifier-", but found "++"
Timer.inc(36) : error 029: invalid expression, assumed zero
Timer.inc(36 -- 37) : error 022: must be lvalue (non-constant)
Timer.inc(36 -- 37) : fatal error 107: too many error messages on one line