Helou Emodev's.
Have have a question. Well I want to run PLAYER_EVENT_ON_UPDATE_ZONE when player Login so in PLAYER_EVENT_ON_LOGIN. I just want to get zone id and with it XpByZone, when player login.
Greeting's, Marko-
Have have a question. Well I want to run PLAYER_EVENT_ON_UPDATE_ZONE when player Login so in PLAYER_EVENT_ON_LOGIN. I just want to get zone id and with it XpByZone, when player login.
Code:
local XpByZone = 1;
function PLAYER_EVENT_ON_LOGIN ( event, player )
local GUID = player:GetGUIDLow();
QueryRow = CharDBQuery ( "SELECT guid FROM bla WHERE guid = '" .. GUID .. "' " );
if( QueryRow == nil ) then
CharDBQuery( "INSERT INTO bla VALUES ('" .. GUID .. "', 1 , 1) ");
player:SendBroadcastMessage( "BLAA!" )
end
end
function PLAYER_EVENT_ON_CHARACTER_DELETE (event, guid)
CharDBQuery( "DELETE FROM bla WHERE guid = '" .. guid .. "' " );
end
function PLAYER_EVENT_ON_UPDATE_ZONE (event, player, newZone, newArea)
if ( player:GetZoneId() == 5010) then
XpByZone = 5;
elseif ( player:GetZoneId() == 5003 ) then
XpByZone = 10;
else
XpByZone = 0;
end
end
Greeting's, Marko-