Jump to content

لوحه التسجيل


Alix2015

Recommended Posts

ساعدوني مدري لما اضغط Login يجي كذا

i_78db5cd6f21.png

وش الحل ؟

ملف سيرفر ذا

addEvent("LoginSystem:Login", true) 
addEventHandler("LoginSystem:Login", root, 
function(user, pass) 
        local Account = getAccount(user, pass) 
        if Account then 
            logIn(source, Account, pass) 
            triggerClientEvent(source, "LoginSystem:onLogin", source) 
            changeTeam[source] = false 
            bindKey(source,"F4", "down",ChangeTeam) 
        else 
        outputChatBox("Wrong username or password!", source, 255, 255, 0) 
    end 
end) 
  
  
  
addEvent("LoginSystem:Register", true) 
addEventHandler("LoginSystem:Register", root, 
function(user, pass) 
    if not getAccount(user) then 
            local Account = addAccount(user, pass) 
            if Account then 
                outputChatBox("You have successfully registered", source, 0, 255, 0) 
                triggerClientEvent(source, "LoginSystem:onLogin", source) 
            end 
        else 
        outputChatBox("Account with this name already exists", source, 255, 0, 0) 
    end 
end) 
local Teams = { 
    {"Grove Street", 0, 255, 0, false}, 
    {"Vagos", 255, 255, 0, false}, 
    {"Ballas", 128, 0, 128, false}, 
    {"Aztecas", 0, 200, 200, false}, 
    {"Medic", 0, 255, 255, false}, 
    {"Rifa", 206, 126, 98, false}, 
    {"Mafia", 136, 216, 87, false}, 
    {"Russians", 227, 112, 43, false}, 
    {"Police", 0, 0, 255, false}, 
    {"No Team", 255, 0, 0, true}, 
     
--  ["Team Name"] = {Red, Green, Blue, Friendly Fire}, 
} 
  
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for i,v in ipairs(Teams) do 
    local Team = createTeam(v[1], v[2], v[3], v[4] ) 
        setTeamFriendlyFire ( Team, v[5] ) 
    end 
end) 
  
  
changeTeam = {} 
  
  
function ChangeTeam( player ) 
    changeTeam[player] = not changeTeam[player] 
    if  changeTeam[player] then 
        outputChatBox("You will be able to change your teamwhen you die.", player, 0, 255, 0) 
    else 
        outputChatBox("Changing team and skin cancelled.", player, 255, 0, 0) 
    end 
end 
  
addEventHandler("onPlayerWasted", root, 
function() 
    setTimer(function( player ) 
        if changeTeam[player] then 
            triggerClientEvent(player, "LoginSystem:onLogin", player) 
            changeTeam[player] = false 
        else 
            local TeamName = getTeamName(getPlayerTeam(player)) 
            local X, Y, Z, R = unpack(SpawnPoints[TeamName][math.random(#SpawnPoints[TeamName])]) 
            spawnPlayer ( player, X, Y, Z, R, getElementModel(player), 0, 0, getPlayerTeam(player)) 
        end 
    end, 3000, 1, source) 
end) 
  
-------------------- 
--// Restaurant \\-- 
-------------------- 
} 
  
  
local Blips = { 
    { 2105, -1808, 14, 29 }, 
    { 2084, 2224, 12, 29 }, 
    { 2352, 2532, 12, 29 }, 
    { -1721, 1359, 8, 29 }, 
    { -1809, 946, 25, 29 }, 
    { 203, -202, 2, 29 }, 
    { 2756, 2477, 12, 29 }, 
    { 1367, 249, 20, 29 }, 
    { 2333, 75, 26, 29 }, 
    { 2638, 1850, 12, 29 }, 
    { -2155, -2460, 31, 14 }, 
    { -1214, 1830, 42, 14 }, 
    { 929, -1353, 14, 14 }, 
    { 2393, 2042, 12, 14 }, 
    { 2838, 2407, 12, 14 }, 
    { 2102, 2229, 12, 14 }, 
    { 2638, 1671, 12, 14 }, 
    { -1816, 619, 36, 14 }, 
    { -2671, 258, 5, 14 }, 
    { 2398, -1899, 14, 14 }, 
    { 2420, -1510, 25, 14 }, 
    { 173, 1177, 15, 14 }, 
    { 812, -1616, 14, 10 }, 
    { 1199, -918, 44, 10 }, 
    { 2367, 2071, 12, 10 }, 
    { 2473, 2034, 12, 10 }, 
    { 1872, 2042, 12, 10 }, 
    { 2170, 2796, 12, 10 }, 
    { 1158, 2072, 12, 10 }, 
    { -1912, 828, 36, 10 }, 
    { -2356, 1008, 51, 10 }, 
    { -2336, -167, 36, 10 }, 
} 
  
addEventHandler ( "onResourceStart", resourceRoot, 
function  ( ) 
    for i,v in ipairs(Markers)  do 
        local Marker = createMarker ( v[1], v[2], v[3], "cylinder", 2, 255, 0, 0, 100 ) 
        setElementInterior(Marker, v[4]) 
    end 
    for i,v in ipairs (Blips) do 
        createBlip ( v[1], v[2], v[3], v[4], 2, 0, 0, 0, 0, 3, 500 ) 
    end 
end ) 
  
addEventHandler( "onMarkerHit", resourceRoot, 
function( player , DM ) 
    if DM and getElementType(player) == "player" then 
        triggerClientEvent( player, "showRestaurantPanel", player ) 
    end 
end ) 
  
addEventHandler("onPlayerSpawn", root, 
function(_, _, _, _, team) 
    local team = team and getTeamName(team) or "N/A" 
    if team == "Police" then 
        giveWeapon(source, 3, 1) 
        takeWeapon(source, 41) 
    elseif team == "Medic" then 
        giveWeapon(source, 41, 9999) 
        takeWeapon(source, 3) 
    else 
        takeWeapon(source, 3) 
        takeWeapon(source, 41) 
    end 
end) 
  
  
  
  
  
  

Link to comment

كذا

addEventHandler("onPlayerWasted", root, 
function() 
    setTimer(function( player ) 
        if changeTeam[player] then 
            triggerClientEvent(player, "LoginSystem:onLogin", player) 
            changeTeam[player] = false 
        else 
            local TeamName = getTeamName(getPlayerTeam(player)) 
            local X, Y, Z, R = unpack(SpawnPoints[TeamName][math.random(#SpawnPoints[TeamName])]) 
            spawnPlayer ( player, X, Y, Z, R, getElementModel(player), 0, 0, getPlayerTeam(player)) 
        end 
    end, 3000, 1, source) 
end) 

Link to comment

ماني متأكد لكن جرب

  
  
  
changeTeam = {} 
  
  
function ChangeTeam( player ) 
    changeTeam[player] = not changeTeam[player] 
    if  changeTeam[player] then 
        outputChatBox("You will be able to change your teamwhen you die.", player, 0, 255, 0) 
    else 
        outputChatBox("Changing team and skin cancelled.", player, 255, 0, 0) 
    end 
end 
  
addEvent("LoginSystem:Login", true) 
addEventHandler("LoginSystem:Login", root, 
function(user, pass) 
        local Account = getAccount(user, pass) 
        if Account then 
            logIn(source, Account, pass) 
            triggerClientEvent(source, "LoginSystem:onLogin", source) 
            changeTeam[source] = false 
            bindKey(source,"F4", "down",ChangeTeam) 
        else 
        outputChatBox("Wrong username or password!", source, 255, 255, 0) 
    end 
end 
) 
  
  
  
addEvent("LoginSystem:Register", true) 
addEventHandler("LoginSystem:Register", root, 
function(user, pass) 
    if not getAccount(user) then 
            local Account = addAccount(user, pass) 
            if Account then 
                outputChatBox("You have successfully registered", source, 0, 255, 0) 
                triggerClientEvent(source, "LoginSystem:onLogin", source) 
            end 
        else 
        outputChatBox("Account with this name already exists", source, 255, 0, 0) 
    end 
end 
) 
local Teams = { 
    {"Grove Street", 0, 255, 0, false}, 
    {"Vagos", 255, 255, 0, false}, 
    {"Ballas", 128, 0, 128, false}, 
    {"Aztecas", 0, 200, 200, false}, 
    {"Medic", 0, 255, 255, false}, 
    {"Rifa", 206, 126, 98, false}, 
    {"Mafia", 136, 216, 87, false}, 
    {"Russians", 227, 112, 43, false}, 
    {"Police", 0, 0, 255, false}, 
    {"No Team", 255, 0, 0, true}, 
    
--  ["Team Name"] = {Red, Green, Blue, Friendly Fire}, 
} 
  
  
addEventHandler("onResourceStart",resourceRoot, 
function () 
    for i,v in ipairs(Teams) do 
    local Team = createTeam(v[1], v[2], v[3], v[4] ) 
        setTeamFriendlyFire ( Team, v[5] ) 
    end 
end) 
  
addEventHandler("onPlayerWasted", root, 
function() 
    setTimer(function( player ) 
        if changeTeam[player] then 
            triggerClientEvent(player, "LoginSystem:onLogin", player) 
            changeTeam[player] = false 
        else 
            local TeamName = getTeamName(getPlayerTeam(player)) 
            local X, Y, Z, R = unpack(SpawnPoints[TeamName][math.random(#SpawnPoints[TeamName])]) 
            spawnPlayer ( player, X, Y, Z, R, getElementModel(player), 0, 0, getPlayerTeam(player)) 
        end 
    end, 3000, 1, source) 
end) 
  
-------------------- 
--// Restaurant \\-- 
-------------------- 
} 
  
  
local Blips = { 
    { 2105, -1808, 14, 29 }, 
    { 2084, 2224, 12, 29 }, 
    { 2352, 2532, 12, 29 }, 
    { -1721, 1359, 8, 29 }, 
    { -1809, 946, 25, 29 }, 
    { 203, -202, 2, 29 }, 
    { 2756, 2477, 12, 29 }, 
    { 1367, 249, 20, 29 }, 
    { 2333, 75, 26, 29 }, 
    { 2638, 1850, 12, 29 }, 
    { -2155, -2460, 31, 14 }, 
    { -1214, 1830, 42, 14 }, 
    { 929, -1353, 14, 14 }, 
    { 2393, 2042, 12, 14 }, 
    { 2838, 2407, 12, 14 }, 
    { 2102, 2229, 12, 14 }, 
    { 2638, 1671, 12, 14 }, 
    { -1816, 619, 36, 14 }, 
    { -2671, 258, 5, 14 }, 
    { 2398, -1899, 14, 14 }, 
    { 2420, -1510, 25, 14 }, 
    { 173, 1177, 15, 14 }, 
    { 812, -1616, 14, 10 }, 
    { 1199, -918, 44, 10 }, 
    { 2367, 2071, 12, 10 }, 
    { 2473, 2034, 12, 10 }, 
    { 1872, 2042, 12, 10 }, 
    { 2170, 2796, 12, 10 }, 
    { 1158, 2072, 12, 10 }, 
    { -1912, 828, 36, 10 }, 
    { -2356, 1008, 51, 10 }, 
    { -2336, -167, 36, 10 }, 
} 
  
addEventHandler ( "onResourceStart", resourceRoot, 
function  ( ) 
    for i,v in ipairs(Markers)  do 
        local Marker = createMarker ( v[1], v[2], v[3], "cylinder", 2, 255, 0, 0, 100 ) 
        setElementInterior(Marker, v[4]) 
    end 
    for i,v in ipairs (Blips) do 
        createBlip ( v[1], v[2], v[3], v[4], 2, 0, 0, 0, 0, 3, 500 ) 
    end 
end ) 
  
addEventHandler( "onMarkerHit", resourceRoot, 
function( player , DM ) 
    if DM and getElementType(player) == "player" then 
        triggerClientEvent( player, "showRestaurantPanel", player ) 
    end 
end ) 
  
addEventHandler("onPlayerSpawn", root, 
function(_, _, _, _, team) 
    local team = team and getTeamName(team) or "N/A" 
    if team == "Police" then 
        giveWeapon(source, 3, 1) 
        takeWeapon(source, 41) 
    elseif team == "Medic" then 
        giveWeapon(source, 41, 9999) 
        takeWeapon(source, 3) 
    else 
        takeWeapon(source, 3) 
        takeWeapon(source, 41) 
    end 
end) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...