PDA

View Full Version : problem with Area function


Lander
04-30-2009, 05:04 PM
Hello

I've create two areas on my script, with text and some bots and cars. The problem is:

1-. The area A shows the text if the area B doesn't exist in the script.
2-. The area A and area B doesn't show his text if both are in the script.
3-. The Area B doesn't show the text if the area A doens't exist in the script.

This error is strange for me, because i've copied the old function of Area A to make Area B. Anyway, here is the script:

Area A
local nofdArea = createArea (453.04016113281, -89.521903991699,9.983747, 500.05072021484, -26.675813674927, 19.363628387451)
function onPlayerEnterArea (playerID, areaID)
if areaID == nofdArea then
gameTextForPlayer(playerID, "Club Malibu, propiedad del clan NOFD", 4, 2000)
end
end


Area B
local pdmArea = createArea (457.69165039063,644.30786132813,11.222978591919,3 95.4794921875,575.14270019531,25.294151306152)
function onPlayerEnterArea (playerID, areaID)
if areaID == pdmArea then
gameTextForPlayer(playerID, "Casa Swanko, propiedad del clan PDM", 4, 2000)
end
end

[NoN]Bruno
05-01-2009, 01:34 PM
local nofdArea = createArea (453.04016113281, -89.521903991699,9.983747, 500.05072021484, -26.675813674927, 19.363628387451)
local pdmArea = createArea (457.69165039063,644.30786132813,11.222978591919,3 95.4794921875,575.14270019531,25.294151306152)
function onPlayerEnterArea (playerID, areaID)
if AreaID == nofdArea then
gameTextForPlayer(playerID, "Club Malibu, propiedad del clan NOFD", 4, 2000)
return end

if AreaID == pdmArea then
gameTextForPlayer(playerID, "Casa Swanko, propiedad del clan PDM", 4, 2000)
return end

end


You CANT add function OnPlayerEnterArea twice, its a callback,you CAN keep ading IF's to the callback. Tell me if that works.I couldnt test it, maybe you can.

Hope it works.

Lander
05-10-2009, 02:59 PM
Well, works only in the nofdArea, the pdmArea doesn't show