21.04.2013, 14:13
Hi i tryed to create a level system but it dosn't work level just up innto 1 and thats all.
new Text:Textdraw2;
new lygis[150];
ongamemodeinitnew Text:Textdraw2;
new lygis[150];
Код:
Textdraw2 = TextDrawCreate(521.000000, 139.000000, "LYGIS:~r~"); TextDrawBackgroundColor(Textdraw2, 255); TextDrawFont(Textdraw2, 1); TextDrawLetterSize(Textdraw2, 0.600000, 2.000000); TextDrawColor(Textdraw2,-572662273); TextDrawSetOutline(Textdraw2, 1); TextDrawSetProportional(Textdraw2, 1);
Quote:
Quote:
|
Код:
new string[ 128 ]; if(GetPlayerScore(playerid) >=200) { lygis = "5"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 8000 && GetPlayerScore(playerid) < 15000) { lygis = "4"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 5000 && GetPlayerScore(playerid) < 7999) { lygis = "3"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 2001 && GetPlayerScore(playerid) < 4999) { lygis = "2"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 199 && GetPlayerScore(playerid) < 2000) { lygis = "1"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 199) { lygis = "0"; /// The rank name TextDrawSetString(Textdraw2, string); } format( string, sizeof string, "~y~LYGIS:~w~ %s",lygis); TextDrawSetString(Textdraw2, string); TextDrawShowForPlayer( playerid, Textdraw2 );
and timer
Код:
forward LYGIS(playerid); public LYGIS(playerid) { new string[ 128 ]; if(GetPlayerScore(playerid) >=200) { lygis = "5"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 8000 && GetPlayerScore(playerid) < 15000) { lygis = "4"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 5000 && GetPlayerScore(playerid) < 7999) { lygis = "3"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 2001 && GetPlayerScore(playerid) < 4999) { lygis = "2"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 199 && GetPlayerScore(playerid) < 2000) { lygis = "1"; /// The rank name TextDrawSetString(Textdraw2, string); } else if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 199) { lygis = "0"; /// The rank name TextDrawSetString(Textdraw2, string); } format( string, sizeof string, "~y~LYGIS:~w~ %s",lygis); TextDrawSetString(Textdraw2, string); TextDrawShowForPlayer( playerid, Textdraw2 ); return 1; }
Whats wrong why dosn't workt?