Hulkkiller Posted October 17, 2010 Share Posted October 17, 2010 (edited) I need help for a copmode: " -- Error here" is for die Errors I have 2 Errors (saying the MTA Server Console) -- Start of the Lua Script function SetTheCops ( source, commandName ) setPlayerTeam ( source, copTeam ) setPedSkin ( source, 285 ) setPedArmor ( source, 100 ) setPlayerNametagColor ( source, 0, 0, 255 ) local x, y, z = getElementPosition ( source ) local angle = getPedRotation ( source ) local cop_vehicle = createVehicle ( 598, x, y, z ) setVehicleRotation ( cop_vehicle, 0, 0, angle ) warpPedIntoVehicle ( source, cop_vehicle ) setVehicleSirensOn ( cop_vehicle, true ) end function SetTheGangster ( source_g, commandName ) if countPlayersInTeam ( gangTeam ) == 0 then thegangster = source_g setPlayerTeam ( source_g, gangTeam ) setPedSkin ( source_g, 107 ) setPedArmor ( source_g, 100 ) setPlayerNametagColor ( source_g, 255, 0, 0 ) local x_g, y_g, z_g = getElementPosition ( source_g ) local angle_g = getPedRotation ( source_g ) local vehicle_g = createVehicle ( 445, x_g, y_g, z_g ) setVehicleRotation ( vehicle_g, 0, 0, angle_g ) warpPedIntoVehicle ( source_g, vehicle_g ) outputChatBox ( thegangster .. " is the Gangster." ) -- Error here else outputChatBox ( "Don't can set the Gangster", getRootElement(), 255, 255, 255, true ) end end function GetTheGangster ( player_g, commandName ) if countPlayersInTeam ( gangTeam ) == 1 then outputChatBox ( "The Gangster is " .. thegangster .. ".", getRootElement(), 255, 255, 255, true ) -- Error here else outputChatBox ( "We don't have a Gangster.", getRootElement(), 255, 255, 255, true ) end end function RemovePlayer ( player, commandName ) setPlayerTeam ( player, nil ) setPlayerNametagColor ( player, 0, 255, 0 ) outputChatBox ( "Set the Gang of none.", getRootElement(), 255, 255, 255, true ) end function createTeamsOnStart() copTeam = createTeam ( "Police" , 0, 0, 255 ) gangTeam = createTeam ( "Gangster", 255, 0, 0 ) setTeamColor ( copTeam, 0, 0, 255 ) setTeamColor ( gangTeam, 255, 0, 0 ) setTeamFriendlyFire ( copTeam, true ) setTeamFriendlyFire ( gangTeam, true ) -- No Colors in the Map end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) addCommandHandler ("police", SetTheCops) addCommandHandler ("gangster", SetTheGangster) addCommandHandler ("gangster_get", GetTheGangster) addCommandHandler ("none", RemovePlayer) -- End of the Lua Script Edited October 17, 2010 by Guest Link to comment
Castillo Posted October 17, 2010 Share Posted October 17, 2010 whats the point of changing the color of the team when u already creating it with color?? Link to comment
dzek (varez) Posted October 17, 2010 Share Posted October 17, 2010 outputChatBox ( thegangster .. " is the Gangster." ) -- the gangster is player element, not string with his name.. outputChatBox ( getPlayerName(thegangster) .. " is the Gangster." ) -- 2nd problem = same problem. Link to comment
Hulkkiller Posted October 17, 2010 Author Share Posted October 17, 2010 Thank for the Help. --------------------- Police vs Gangster --------------------- I need a two help with the Chatbox (all player's can read the messages) Link to comment
dzek (varez) Posted October 17, 2010 Share Posted October 17, 2010 I need a two help with the Chatbox (all player's can read the messages) wtf? explain what do you want to do Link to comment
12p Posted October 17, 2010 Share Posted October 17, 2010 ( getPlayerName(thegangster) .. " is the Gangster.", theGangster ) If you want to make only a player read the chatbox message, add a player element after the message (in this case, theGangster). Link to comment
Hulkkiller Posted October 18, 2010 Author Share Posted October 18, 2010 Thank for the Help. 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