Jump to content

TheIceman1

Members
  • Posts

    296
  • Joined

  • Last visited

Everything posted by TheIceman1

  1. But why this doesn't shows player team? function setplayerinf ( ) local row, col = guiGridListGetSelectedItem ( GUIEditor_Grid[1] ) if ( row and col and row ~= -1 and col ~= -1 ) then local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], row, 1 ) local player = getPlayerFromName ( playerName ) if ( player ) then local name = getPlayerName( player ) local team = getPlayerTeam ( player ) local tname = getTeamName ( team ) local role = getElementData( player, "Role" ) local gang = getElementData ( player, "gang" ) guiSetText ( GUIEditor_Label[1], "Name:"..name ) guiSetText ( GUIEditor_Label[2], "Team:"..tname ) guiSetText ( GUIEditor_Label[3], "Role:"..role ) guiSetText ( GUIEditor_Label[6], "Gang:"..gang ) end end end addEventHandler ( "onClientGUIClick", GUIEditor_Grid[1], setplayerinf, false )
  2. @50p: But this code showing me "false" or "true",not wanted level. I remade this code but this showing me only name not wanted level. Client: function setplayers () for id, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[2], tostring( getElementData( player, "wantedLevel" ) ), false, false ) end end addEventHandler ( "onClientResourceStart", resourceRoot, setplayers ) Server: _getPlayerWantedLevel = getPlayerWantedLevel; function getPlayerWantedLevel( player, level ) setElementData( player, "wantedLevel", level ); return _getPlayerWantedLevel( player ); end
  3. TheIceman1

    Help pls

    Why this dont show me(name,team,gang,role...) on labels?No errors function setplayerinf() local playerName = guiGridListGetItemText ( GUIEditor_Grid[1], guiGridListGetSelectedItem ( GUIEditor_Grid[1] ), 1 ) local name = getPlayerName( playerName ) local team = getPlayerTeam( playerName ) local role = getElementData( playerName, "Role" ) local gang = getElementData ( playerName, "gang" ) local wl = getPlayerWantedLevel ( playerName ) guiSetText ( GUIEditor_Label[5], "WantedLevel:"..wl ) guiSetText ( GUIEditor_Label[1], "Name:"..name ) guiSetText ( GUIEditor_Label[2], "Team:"..team ) guiSetText ( GUIEditor_Label[3], "Role:"..role ) guiSetText ( GUIEditor_Label[6], "Gang:"..gang ) end addEventHandler ( "onClientGUIclick", GUIEditor_Button[1], setplayerinf )
  4. But then the team has shown on the scoreboard, but like this no.
  5. Yes but with these functions, you can make a gang system / squad system
  6. GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Grid = {} GUIEditor_Column = {} GUIEditor_Window[1] = guiCreateWindow(303,111,463,438,"SACR Police computer",false) guiSetVisible ( GUIEditor_Window[1], false ) GUIEditor_Grid[1] = guiCreateGridList(10,26,204,375,false,GUIEditor_Window[1]) GUIEditor_Column[1] = guiGridListAddColumn(GUIEditor_Grid[1],"Wanted player",0.5) GUIEditor_Column[2] = guiGridListAddColumn(GUIEditor_Grid[1],"Wanted player",0.5) GUIEditor_Button[1] = guiCreateButton(9,408,205,21,"Blip player",false,GUIEditor_Window[1]) GUIEditor_Label[1] = guiCreateLabel(218,27,241,74,"My informations:",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(226,46,224,27,"Account name:",false,GUIEditor_Window[1]) GUIEditor_Label[3] = guiCreateLabel(226,65,227,27,"Arrests:",false,GUIEditor_Window[1]) GUIEditor_Label[4] = guiCreateLabel(226,85,233,26,"Hours:",false,GUIEditor_Window[1]) GUIEditor_Label[5] = guiCreateLabel(226,106,231,28,"Group:",false,GUIEditor_Window[1]) GUIEditor_Label[6] = guiCreateLabel(216,122,240,51,"Wanted player information:",false,GUIEditor_Window[1]) GUIEditor_Label[7] = guiCreateLabel(229,143,213,27,"Account name:",false,GUIEditor_Window[1]) GUIEditor_Label[8] = guiCreateLabel(229,166,223,21,"Hours:",false,GUIEditor_Window[1]) GUIEditor_Label[9] = guiCreateLabel(227,188,214,22,"Group:",false,GUIEditor_Window[1]) GUIEditor_Label[10] = guiCreateLabel(227,207,221,22,"Wanted level:",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(225,380,224,49,"Close",false,GUIEditor_Window[1]) function setplayers () for id, player in ipairs(getElementsByType("player")) do if ( triggerServerEvent ( player, "wantedplayers" ) ) then local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) end end end addEventHandler ( "onClientResourceStart", getThisResource(), setplayers )
  7. TheIceman1

    Group

    I suggest for make group functions, "createGroup(group name)" this function making group/gang,"setGroupLeader( source, group name ) this function sets group leader,"getGroupLeader( group name )" this function gets group leader,"invitePlayerInGroup( source, group name )" this function invite players in groups, "kickPlayerFromGang ( source, group name )" this function kicking player from group, "isPlayerInGroup( source )" this function showing you if is player in group,"getGroupName( group )" this function showing you group name,"getPlayerGroup( source) " this function gets players group,"setPlayerGroup( source, groupname )" this function sets players group(if group leader invite this player),"setGroupColor( group name, r, g, b )" this function sets group color,"getGroupColor( group name )" this function gets group color,"getPlayersInGroup ( group name)" this function gets players from group.
  8. TheIceman1

    Pomoč

    Ovako,zašto mi ovaj kod pokaže wanted players samo kad restartam resource,a kad otipkam /reconnect onda mi nece pokazat... for id, player in ipairs(getElementsByType("player")) do if (getPlayerWantedLevel(player) > 0) then local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[2], getPlayerWantedLevel( player ), false, false ) end end
  9. But i dont have an idea how to make it...
  10. Whats wrong here?Nothing happens. Server: function wantedplayers () local wl = getPlayerWantedLevel ( source ) if wl > 0 then end end addEvent ( "wantedplayers", true ) addEventHandler ( "wantedplayers", root, wantedplayers ) Client: function setplayers () for id, player in ipairs(getElementsByType("player")) do if ( triggerServerEvent ( player, "wantedplayers" ) ) then local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) end end end addEventHandler ( "onClientResourceStart", getThisResource(), setplayers )
  11. How to this,I dont understand.
  12. TheIceman1

    Jail.

    Working,but i didnt get arrests.Maybe is problem here? addEventHandler("onPlayeDamage",root, function (attacker, weapon) local weap = getWeaponNameFromID(3) local skin = getElementModel ( attacker ) local team = getTeamFromName( getPlayerTeam ( attacker ) ) local wl = getPlayerWantedLevel ( source ) if (skin == 280 ) and ( team == "Police" ) and ( wl > 0 ) and ( weap == 3 ) then addPlayerArrests(attacker) end end) function addPlayerArrests(attacker) local account = getPlayerAccount(attacker) if isGuestAccount(account) then return end local arrests = getAccountData(account,"Arrests") if not arrests then setAccountData(account,"Arrests",0) end setAccountData(account,"Arrests",tonumber(arrests)+1) setElementData(attacker,"Arrests",tonumber(arrests)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local arrests = getAccountData(account,"Arrests") if arrests then setElementData(source,"Arrests",tostring(arrests)) else setElementData(source,"Arrests",0) end end)
  13. TheIceman1

    Jail.

    Why this dont respawn me at position(source, 1546.51, -1675.71, 13.5 ,and why i dont get arrest? function wanted1( attacker, attackerweapon ) money = math.random ( 100, 500 ) time = math.random ( 5000, 15000 ) theSkin = getElementModel( attacker ) WL = getPlayerWantedLevel( source ) if (attackerweapon == 3) and ( theSkin == 280 ) and (getPlayerWantedLevel( source ) == 1 ) and ( WL > 0 )) then exports ["guimessages"] : outputServer ( source, "You are jailed by "..getPlayerName(attacker).."." , 25, 25, 255) exports ["guimessages"] : outputServer ( attacker, "You have arrest "..getPlayerName(source).."." , 25, 25, 255) givePlayerMoney ( attacker, money ) playeraccount = getPlayerAccount( attacker ) arrestnumber = getAccountData( playeraccount, "Arrests" ) setAccountData ( playeraccount, "Arrests", tonumber(arrestnumber)+1) setElementPosition ( source, 0, 0, 0 ) toggleAllControls ( source, false ) setTimer ( toggleAllControls, time, 1, source, true ) setTimer ( setElementPosition, time, 1, source, 1546.51, -1675.71, 13.5 ) setTimer ( setPlayerWantedLevel, time, 1, source, 0 ) end end addEventHandler ("onPlayerDamage", getRootElement(), wanted1)
  14. When I do / iceman give 100, but then nothing happens, then I do / give TheIceman 100 then I get a message "You sent $100...", how to do that ,when i do /give iceman(part of name) 100 then players get the money? function givemoney(player, _, to, ...) local money = table.concat({...}," ") local personToReceive = getPlayerFromName(to) if personToReceive then givePlayerMoney ( personToRecieve, tonumber(money) ) takePlayerMoney ( player, tonumber(money) ) exports ["guimessages"] : outputServer ( player, "You sent $ ".. money .." to "..getPlayerName(player).."!" , 255, 255, 0 ) exports ["guimessages"] : outputServer ( personToReceive, getPlayerName(player).." sent $"..money.." you!", 255, 255, 0 ) end end addCommandHandler ( "give", givemoney )
  15. Dont work. @Solidsnake14:But how to put wanted level of players on the grid list? for id, player in ipairs(getElementsByType("player")) do if (getPlayerWantedLevel(player) > 0) then local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[2], getPlayerWantedLevel( player ), false, false ) end end This code showing me players and their wanted levels,but problem is that when i do /reconnect the i cant see players on grid list and their wanted levels.
×
×
  • Create New...