Jump to content

Whats wrong here?


Recommended Posts

Hey i maked this simple script, but whats wrong??

function PartyMode() 
setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) 
end 
  
function StartParty() 
if isPlayerInACLGroup(player, g_GameOptions.admingroup) then 
outputChatBox("#ff0000[#0088ffPARTY#ff9e00]#ff0000APS #0000FFparty #ff9e00 mode #00ff00ON#ff9e00!", 255, 255, 255, true) 
pTimer = setTimer ( PartyMode, 100, 0 ) 
else 
outputChatBox("#ff0000[#0088ffPARTY#ff9e00]#ffffffFailed at party start!", 255, 255, 255, true) 
    end 
end  
addCommandHandler("party", PartyMode) 
  
function StopParty() 
killTimer( pTimer ) 
outputChatBox("#ff0000[#0088ffPARTY#ff9e00]#ffffffParty Finished !!", 255, 255, 255, true) 
end 
addCommandHandler("sparty", StopParty) 

Link to comment

Changed but doesn't work! :(

Client-Side

function PartyMode() 
setSkyGradient ( math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255) ) 
end 
  
function StartParty() 
pTimer = setTimer ( PartyMode, 100, 0 ) 
end  
addEvent("onPartyStart", true) 
addEventHandler("onPartyStart", getRootElement(), StartParty) 
  
function StopParty() 
killTimer( pTimer ) 
end 
addEvent("onPartyStop", true) 
addEventHandler("onPartyStop", getRootElement(), StopParty) 

Server-Side

function StartParty() 
if isPlayerInACLGroup(player, g_GameOptions.admingroup) then 
outputChatBox("#ff0000[#0088ffPARTY#ff9e00]#ff0000APS #0000FFparty #ff9e00 mode #00ff00ON#ff9e00!", 255, 255, 255, true) 
triggerClientEvent( "onPartyStart", getRootElement() ) 
else 
outputChatBox("#ff0000[#0088ffPARTY#ff9e00]#ffffffFailed at party start!", 255, 255, 255, true) 
    end 
end  
addCommandHandler("party", PartyMode) 
  
function StopParty() 
triggerClientEvent( "onPartyStop", getRootElement() ) 
outputChatBox("#ff0000[#0088ffPARTY#ff9e00]#ffffffParty mode #ff0000Off!#ffffff.", 255, 255, 255, true) 
end 
addCommandHandler("sparty", StopParty) 

Link to comment
  • Other Languages Moderators

Where is function isPlayerInACLGroup?

And where player and g_GameOptions.admingroup defined?

Also server side outputChatBox require player argument.

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...