02.02.2010, 17:56
i've made a score textdraw that appears top of the screen but its not working :S
Onplayerspawn :
Onplayerrequestclass :
Ongamemodeinit (the textdraw part) :
can anyone help me?
Onplayerspawn :
Код:
public OnPlayerSpawn(playerid) { if(gTeam[playerid] == TEAM_LS) { SetPlayerColor(playerid,COLOR_GREEN); } else { if(gTeam[playerid] == TEAM_LV) { SetPlayerColor(playerid,COLOR_YELLOW); } } return 1; }
Код:
public OnPlayerRequestClass(playerid, classid) { iSpawnSet[playerid] = 0; SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1961.1343,1342.7173,15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); SetupPlayerForClassSelection(playerid); switch (classid) { case 0: { GameTextForPlayer(playerid, "~g~Los Santos", 1000, 3); SetPlayerColor(playerid,COLOR_GREEN); gTeam[playerid] = TEAM_LS; } case 1: { GameTextForPlayer(playerid, "~Y~Las Venturas", 1000, 3); SetPlayerColor(playerid,COLOR_YELLOW); gTeam[playerid] = TEAM_LV; } } return 1; }
Код:
Textdraw2 = TextDrawCreate(394.000000,1.000000,"LS:[%s]|| LV:[%s]"); new string[128]; format(string, sizeof(string), "LS: %d || LV: %d", lsscore, lvscore); TextDrawSetString(Textdraw2, string); TextDrawShowForAll(Textdraw2); TextDrawAlignment(Textdraw2,0); TextDrawBackgroundColor(Textdraw2,0x0000ffcc); TextDrawFont(Textdraw2,3); TextDrawLetterSize(Textdraw2,0.399999,1.100000); TextDrawColor(Textdraw2,0xffffffff); TextDrawSetOutline(Textdraw2,1); TextDrawSetProportional(Textdraw2,1); TextDrawSetShadow(Textdraw2,1);