Monty Posted August 18, 2012 Share Posted August 18, 2012 sorry what's wrong in this function function joinSAPD() if (isGuestAccount(getPlayerAccount(source)) == false) then local playeraccount = getPlayerAccount (source) if not getElementData(source,"Occupation") == "police" then setPlayerTeam(source,SAPDteam) setElementModel(source, 280) giveWeapon ( source, 3 ) if getElementData(source, "arrest") == 0 then setElementData(source, "arrest", "1") setElementData(source, "Occupation", "police", true) outputChatBox("You are now policeman.",source,0,255,0) else outputChatBox("Error: You already have this work",source,255,0,0) end else outputChatBox ('Error: Please login or register!',source,255,255,255,true) end if getElementData(source, "arrest") == 0 then setElementData(source, "arrest", "1") end end addEvent("setSAPD", true) addEventHandler("setSAPD",root,joinSAPD) Link to comment
Booo Posted August 18, 2012 Share Posted August 18, 2012 sorry what's wrong in this function setPlayerTeam(source,SAPDteam) setPlayerTeam(source,getTeamFromName(SAPDteam)) Link to comment
Monty Posted August 18, 2012 Author Share Posted August 18, 2012 the console say failed to load the resource... Link to comment
Termycraft Posted August 18, 2012 Share Posted August 18, 2012 If the server can't load the resource, there's a problem with the meta.xml, please verify your meta.xml, then retry. Link to comment
Anderl Posted August 18, 2012 Share Posted August 18, 2012 sorry what's wrong in this function setPlayerTeam(source,SAPDteam) setPlayerTeam(source,getTeamFromName(SAPDteam)) It's wrong the same way. addEvent( 'setSAPD', true ) addEventHandler( 'setSAPD', root, function( ) local pAccount = getPlayerAccount( source ) if( pAccount not isGuestAccount( pAccount ) ) then if( getElementData( source, 'Occupation' ) ~= 'police' ) then setPlayerTeam( source, getTeamFromName( 'Police' ) ) -- change 'Police' to the team name setElementModel( source, 280 ) giveWeapon( source, 3 ) -- if( getElementData( source, 'arrest' ) == 0 ) then setElementData( source, 'arrest', 1 ) setElementData( source, 'Occupation', 'police', true ) outputChatBox( 'You are now a Policeman!', source, 0, 255, 0, false ) else outputChatBox( 'Error: You already have this work!', source, 255, 0, 0, false ) end else outputChatBox( 'Error: Please login or register!', source, 255, 255, 255, false ) end if( getElementData( source, 'arrest' ) == 0 ) then setElementModel( source, 'arrest', 1 ) end end end ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now