• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[SOLVED] {ELUNA}Can I Make New Method in Eluna Without C++ ?

Status
Not open for further replies.

Kaev

Super Moderator
Code:
function YOUR_FUNCTION_NAME(YOUR_FUNCTION_ARGUMENTS)

end
This is not related to Eluna and could be googled in like 5 seconds. Please use Google before asking such basic things.
 

Rochet2

Moderator / Eluna Dev

ALILP

Emulation Addict
Code:
function Player:GetVIP(player)
local ViP = AuthDBQuery("SELECT `vip` FROM `account` WHERE `id`='"..player:GetAccountId().."'")
ViP = ViP:GetUInt32(0)
end
function salam(event, player, message, lang, Type)
if (message:lower() == "salam")then
if(player:GetVIP() == 7)then
player:SendBroadCastMessage("salam")
end
end
end
RegisterPlayerEvent(18, salam)
im testing custom method!
did i make a mistake in it?(it is not working)
 

Rochet2

Moderator / Eluna Dev
Code:
[COLOR="#FF0000"]function Player:GetVIP(player)[/COLOR]
    local ViP = AuthDBQuery("SELECT `vip` FROM `account` WHERE `id`='"..player:GetAccountId().."'")
    ViP = ViP:GetUInt32(0)
end
function salam(event, player, message, lang, Type)
    if (message:lower() == "salam")then
        if(player:GetVIP() == 7)then
            player:SendBroadCastMessage("salam")
        end
    end
end
RegisterPlayerEvent(18, salam)
im testing custom method!
did i make a mistake in it?(it is not working)

Yes. You see, you used
Code:
function Player[COLOR="#FF0000"][B]:[/B][/COLOR]GetVIP(player)
and you should have used
Code:
function Player[COLOR="#FF0000"][B].[/B][/COLOR]GetVIP(player)



or function Player:GetVIP() and instead of player use the variable called self
 
Status
Not open for further replies.
Top