Tematy otagowane jako: ustawia
1. Nie ustawia napisu nowej mapy
Cze??, mam kod do race, ale jest z nim problem bo gdy ustawiam nast?pn? map? to pisze mi ca?y czas [color=red]Random[/color].
[lua]function setNextNil ( dis )
g_NextMap = "Random"
end
addEvent ( "setNextNil", true )
addEventHandler ( "setNextNil", getRootElement(), setNextNil )
function hudSet ()
local screenWidth, screenHeight = guiGetScreenSize()
dxDrawColorText ('Next: ' .. g_NextMap, 2+1, screenHeight - dxGetFontHeight(1, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 0, 0, 0, 255 ), 0.6, 'bankgothic', 0.6, 'left')
dxDrawColorText ('#FF9900Next: #FFFFFF' .. g_NextMap, 2, screenHeight - dxGetFontHeight(1, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.6, 'bankgothic', 0.6, 'left')
if (g_MapInfo) then
dxDrawColorText ('Map: ' .. g_MapInfo.name, 2+1, screenHeight - dxGetFontHeight(2, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 0, 0, 0, 255 ), 0.6, 'bankgothic', 0.6, 'left')
dxDrawColorText ('#FF9900Map: #FFFFFF' .. g_MapInfo.name, 2, screenHeight - dxGetFontHeight(2, 'bankgothic')/2, 100, 100, tocolor ( 255, 255, 255, 255 ), 0.6, 'bankgothic', 0.6, 'left')
else
dxDrawColorText ('Map: N/A', 2+1, screenHeight - dxGetFontHeight(2, 'bankgothic')/2.1, 100, 100, tocolor ( 0, 0, 0, 255 ), 0.6, 'bankgothic', 0.6, 'left')
dxDrawColorText ('#FF9900Map: #FFFFFFRandom', 2, screenHeight - dxGetFontHeight(2, 'bankgothic')/2+1, 100+1, 100+1, tocolor ( 255, 255, 255, 255 ), 0.6, 'bankgothic', 0.6, 'left')
end
dxDrawColorText ('Specta...
2. [INNE] Logowanie - nie ustawia gangu. MySQL.
Po zalogowaniu nie ustawia mi gangu,kt?ry jest wpisany do bazy.W grze jak ustawi? i wyjd? to zapisuje a po zalogowaniu ustawia na gang 0(nawet takiego nie ma).
Funkcja:
Kod: if(mysql_num_rows() != 0)
{
new name[24];
Zalogowany[playerid] = 1;
mysql_fetch_row(string, "|");
sscanf(string, "p<|>s[24]s[145]s[17]dddddd", name, HashedPW, IP, PlayerData[playerid][AdminLevel], PlayerData[playerid][Score], PlayerData[playerid][Money], PlayerData[playerid][Kills], PlayerData[playerid][Deaths], PlayerData[playerid][Frakcja]);
format(string, sizeof(string), "UPDATE `Konta` SET `IP` = '%s' WHERE Nick= '%s'", PlayerIP(playerid), GetPlayerNick(playerid));
print(string);
mysql_query(string);
SetPlayerScore(playerid, PlayerData[playerid][Score]);
GiveMoney(playerid, PlayerData[playerid][Money]);
TogglePlayerSpectating(playerid, 0);
SetPlayerTeam(playerid, PlayerData[playerid][Frakcja]);