Miika Posted October 17, 2014 Posted October 17, 2014 (edited) I have problem with getTeamName. I am criminal but it says: You need to be criminal [server] function createRob() Marker = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,49) outputChatBox( "Alkon ryöstö on saatavilla. Ryöstä se viinakuvakkeen luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createRob) addEventHandler("onMarkerLeave",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end if ( getTeamName == "Criminal" ) then destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 5000, 20000 ) randomWanted = math.random ( 1, 6 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, randomWanted ) robPlayer = getPlayerName(player) outputChatBox("#ffffff[#00ff00ALARM!#ffffff] #c48027" .. robPlayer .. " #ff0000ryösti alkon, sai #00ff00" .. tostring(randomMoney) .."$ #ff0000ja #00ff00" .. tostring(randomWanted) .. "#ff0000 tähteä.",root,0,255,0,true) setTimer( createRob, 600000, 1 ) else outputChatBox("You need to be criminal!", player, 255, 255, 0) end end ) Edited October 17, 2014 by Guest
ZL|LuCaS Posted October 17, 2014 Posted October 17, 2014 [server] function createRob() Marker = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,49) outputChatBox( "Alkon ryöstö on saatavilla. Ryöstä se viinakuvakkeen luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createRob) addEventHandler("onMarkerLeave",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end local playerTeam = getPlayerTeam(player) if ( getTeamName(playerTeam) == "Criminal" ) then destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 5000, 20000 ) randomWanted = math.random ( 1, 6 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, randomWanted ) robPlayer = getPlayerName(player) outputChatBox("#ffffff[#00ff00ALARM!#ffffff] #c48027" .. robPlayer .. " #ff0000ryösti alkon, sai #00ff00" .. tostring(randomMoney) .."$ #ff0000ja #00ff00" .. tostring(randomWanted) .. "#ff0000 tähteä.",root,0,255,0,true) setTimer( createRob, 600000, 1 ) else outputChatBox("You need to be criminal!", player, 255, 255, 0) end end ) try this
RenanPG Posted October 17, 2014 Posted October 17, 2014 To get the team name use: local teamName = getTeamName(getPlayerTeam(player)) You used just getTeamName, you need to specify the team element.
Miika Posted October 17, 2014 Author Posted October 17, 2014 [server] function createRob() Marker = createMarker ( 252.3,-54.6,0.9, "cylinder", 1, 255, 255, 0, 170 ) setElementCollisionsEnabled( Marker, false ) bl = createBlipAttachedTo(Marker,49) outputChatBox( "Alkon ryöstö on saatavilla. Ryöstä se viinakuvakkeen luota.", root, 0, 255, 0 ) end addEventHandler("onResourceStart", resourceRoot,createRob) addEventHandler("onMarkerLeave",root, function ( player ) if ( source ~= Marker ) then return end if ( isPedInVehicle( player ) ) then return end local playerTeam = getPlayerTeam(player) if ( getTeamName(playerTeam) == "Criminal" ) then destroyElement( Marker ) destroyElement( bl ) randomMoney = math.random ( 5000, 20000 ) randomWanted = math.random ( 1, 6 ) givePlayerMoney(player,randomMoney) setPlayerWantedLevel ( player, randomWanted ) robPlayer = getPlayerName(player) outputChatBox("#ffffff[#00ff00ALARM!#ffffff] #c48027" .. robPlayer .. " #ff0000ryösti alkon, sai #00ff00" .. tostring(randomMoney) .."$ #ff0000ja #00ff00" .. tostring(randomWanted) .. "#ff0000 tähteä.",root,0,255,0,true) setTimer( createRob, 600000, 1 ) else outputChatBox("You need to be criminal!", player, 255, 255, 0) end end ) try this It works! Thx
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