WASSIm. Posted January 13, 2013 Share Posted January 13, 2013 this script not work --Client function assignModsTeam (player) if ( hasObjectPermissionTo (player, "general.adminpanel", false ) ) then local staffteam = getTeamFromName ( "STAFF" ) if ( staffteam ) then setPlayerTeam ( source, staffteam ) giveWeapon ( player, 5, 10000 ) giveWeapon ( player, 24, 10000 ) giveWeapon ( player, 27, 10000 ) giveWeapon ( player, 29, 10000 ) giveWeapon ( player, 31, 10000 ) giveWeapon ( player, 34, 10000 ) giveWeapon ( player, 38, 10000 ) giveWeapon ( player, 46, 10000 ) setPedArmor ( player, 100 ) setElementModel ( player, 217 ) setPlayerNametagColor ( player, 255, 0, 0 ) createBlipAttachedTo ( player, 0, 2, 255, 0, 0 ) setPlayerWantedLevel ( player, 6 ) end end end addEventHandler ( "onPlayerLogin", getRootElement(), assignModsTeam ) function destroyElement () destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement ) Link to comment
Sparrow Posted January 13, 2013 Share Posted January 13, 2013 (edited) in which line is the problem? change source on line 5 to player to set your team to "STAFF" Edited January 13, 2013 by Guest Link to comment
Castillo Posted January 13, 2013 Share Posted January 13, 2013 function destroyElement () destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement ) You are creating an stack overflow. function destroyElement_ () destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement_ ) Link to comment
WASSIm. Posted January 13, 2013 Author Share Posted January 13, 2013 in which line is the problem? i dont know my script not work Link to comment
WASSIm. Posted January 13, 2013 Author Share Posted January 13, 2013 function destroyElement () destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement ) You are creating an stack overflow. function destroyElement_ () destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement_ ) not work Link to comment
Vanlot Posted January 13, 2013 Share Posted January 13, 2013 first of all this function working only on server side,So change the file to server side. hasObjectPermissionTo the blip is not defined so use this instead of line 17 local myBlip = createBlipAttachedTo ( player, 0, 2, 255, 0, 0 ) also try to change the function name for example: function destroyBlip() destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyBlip) Link to comment
WASSIm. Posted January 13, 2013 Author Share Posted January 13, 2013 first of all this function working only on server side,So change the file to server side. hasObjectPermissionTo the blip is not defined so use this instead of line 17 local myBlip = createBlipAttachedTo ( player, 0, 2, 255, 0, 0 ) also try to change the function name for example: function destroyBlip() destroyElement(myBlip) end addEventHandler ( "onPlayerQuit", getRootElement(), destroyBlip) WARNING: Group_staff\admin_spawn.lua:1: Bad argument @ script not work Link to comment
abu5lf Posted January 13, 2013 Share Posted January 13, 2013 blip = {} function assignModsTeam( ) if hasObjectPermissionTo ( source, "general.adminpanel", false ) then local staffteam = getTeamFromName ( "STAFF" ) if ( staffteam ) then setPlayerTeam ( source, staffteam ) giveWeapon ( source, 5, 10000 ) giveWeapon ( source, 24, 10000 ) giveWeapon ( source, 27, 10000 ) giveWeapon ( source, 29, 10000 ) giveWeapon ( source, 31, 10000 ) giveWeapon ( source, 34, 10000 ) giveWeapon ( source, 38, 10000 ) giveWeapon ( source, 46, 10000 ) setPedArmor ( source, 100 ) setElementModel ( source, 217 ) setPlayerNametagColor ( source, 255, 0, 0 ) blip[ source ] = createBlipAttachedTo ( source, 0, 2, 255, 0, 0 ) setPlayerWantedLevel ( source, 6 ) end end end addEventHandler ( "onPlayerLogin", getRootElement(), assignModsTeam ) function destroyElement_( ) if isElement( blip[ source ] ) then destroyElement( blip[ source ] ) blip[ source ] = nil end end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement_ ) Link to comment
WASSIm. Posted January 13, 2013 Author Share Posted January 13, 2013 blip = {} function assignModsTeam( ) if hasObjectPermissionTo ( source, "general.adminpanel", false ) then local staffteam = getTeamFromName ( "STAFF" ) if ( staffteam ) then setPlayerTeam ( source, staffteam ) giveWeapon ( source, 5, 10000 ) giveWeapon ( source, 24, 10000 ) giveWeapon ( source, 27, 10000 ) giveWeapon ( source, 29, 10000 ) giveWeapon ( source, 31, 10000 ) giveWeapon ( source, 34, 10000 ) giveWeapon ( source, 38, 10000 ) giveWeapon ( source, 46, 10000 ) setPedArmor ( source, 100 ) setElementModel ( source, 217 ) setPlayerNametagColor ( source, 255, 0, 0 ) blip[ source ] = createBlipAttachedTo ( source, 0, 2, 255, 0, 0 ) setPlayerWantedLevel ( source, 6 ) end end end addEventHandler ( "onPlayerLogin", getRootElement(), assignModsTeam ) function destroyElement_( ) if isElement( blip[ source ] ) then destroyElement( blip[ source ] ) blip[ source ] = nil end end addEventHandler ( "onPlayerQuit", getRootElement(), destroyElement_ ) thx 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