Jump to content

Castillo

Retired Staff
  • Posts

    21,935
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Castillo

  1. There's no event for when a new resource is loaded.
  2. You can trigger the ped to the client side and then set the voice?
  3. -- client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Grid = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(448,205,604,391,"[servergroup] Panel v1.0",false) guiWindowSetMovable(GUIEditor_Window[1],false) guiWindowSetSizable(GUIEditor_Window[1],false) GUIEditor_Grid[1] = guiCreateGridList(9,18,190,409,false,GUIEditor_Window[1]) guiGridListAddColumn(GUIEditor_Grid[1],"Players",0.6) GUIEditor_Button[1] = guiCreateButton(200,25,158,42,"servergroup_assigned",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[1],"clear-normal") GUIEditor_Button[2] = guiCreateButton(425,28,170,40,"servergroup_revoked",false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Button[2],"clear-normal") GUIEditor_Image[1] = guiCreateStaticImage(262,118,318,264,"images/mtalogo.png",false,GUIEditor_Window[1]) function loadPlayersToGrid() guiGridListClear(GUIEditor_Grid[1]) for index, player in ipairs(getElementsByType("player")) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1],row,1,tostring(getPlayerName(player)),false,false) end end loadPlayersToGrid() addEventHandler("onClientPlayerJoin",root,loadPlayersToGrid) addEventHandler("onClientPlayerQuit",root,loadPlayersToGrid) addEventHandler("onClientPlayerChangeNick",root,loadPlayersToGrid) addEventHandler("onClientGUIClick",root, function () if (source == GUIEditor_Button[1]) then 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 playSound("sounds/servergroup_assigned.wav") outputChatBox(getPlayerName(player) .. " [ serverGroup_assigned] ! ",255,255,0) triggerServerEvent("assignGroup",localPlayer,player,true) end end elseif (source == GUIEditor_Button[2]) then 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 playSound("sounds/servergroup_revoked.wav") outputChatBox(getPlayerName(player) .. " [ servergroup_revoked] ! ",255,0,0) triggerServerEvent("assignGroup",localPlayer,player,false) end end end end ) function toggleGUI() if guiGetVisible(GUIEditor_Window[1]) == true then guiSetVisible(GUIEditor_Window[1],false) showCursor(false) else guiSetVisible(GUIEditor_Window[1],true) showCursor(true) end end addEvent("toggleGUI",true) addEventHandler("toggleGUI",root,toggleGUI) -- server side: addEvent("assignGroup",true) addEventHandler("assignGroup",root, function (player, assign) if (player) then if (assign) then setElementData(player,"why","Registred !") outputChatBox(" [ ServerGroup_assigned ] !",player,255,255,0) if getTeamFromName ( "spectator" ) then setPlayerTeam(player, getTeamFromName ( "spectator" )) end else setElementData(player,"why" ,"Blocked !") setPlayerTeam(player, nil) local account = getPlayerAccount(player) if (account) then removeAccount(account) end end end end )
  4. Yes, that's it, remove that and it has to work.
  5. That's just a mess, go back to the wiki and start from the beginning.
  6. Yeah, but maybe he put that function inside zombies, in that case he doesn't need to.
  7. What exactly doesn't work? the ped is created?
  8. Castillo

    Problems

    This should work: function DestructionWin( ) local playersOnline = getPlayerCount() local rank = tonumber(exports.race:getPlayerRank(source)) or 1 local firstMoney = tonumber(playersOnline)*20 or 1 local secondMoney = tonumber(playersOnline)*10 or 1 local thirdMoney = tonumber(playersOnline)*5 or 1 local anotherMoney = tonumber(playersOnline)*2 local account = getPlayerAccount(source) if isGuestAccount(account) then outputChatBox ( "#FFA824 Dude , you need to log in to get the prizes.", source, 255,255,255,true ) else if (rank == 1) then setAccountData( account, "Race Wins", tonumber( getAccountData( account,"Race Wins" or 0 ) )+1 ) outputChatBox ( "#FFA824 CONGRATZ ! The player " .. getPlayerName( source ) .. " won "..tostring(firstMoney).." and 5 Points. !", root, 255, 255, 255, true ) setAccountData( account,"Money", tonumber( getAccountData( account,"Money" ) or 0 ) + firstMoney ) setAccountData( account,"Money", tonumber( getAccountData( account,"Points" ) or 0 ) + 5 ) elseif (rank == 2) then setAccountData( account, "Race Loses", tonumber( getAccountData( account,"Race Loses" or 0 ) )+1 ) outputChatBox ( "#FFA824 You lost. I wish you luck in the next round. Also you won "..tostring(secondMoney).." and 3 Points for being on the 2nd place.", source, 255, 255, 255, true ) setAccountData( account,"Money", tonumber( getAccountData( account,"Money" ) or 0 ) + secondMoney ) setAccountData( account,"Money", tonumber( getAccountData( account,"Points" ) or 0 ) + 3 ) elseif (rank == 3) then setAccountData( account, "Race Loses", tonumber( getAccountData( account,"Race Loses" or 0 ) )+1 ) outputChatBox ( "#FFA824 You lost. I wish you luck in the next round. Also you won "..tostring(thirdMoney).." and 1 Point for being on the 3th place.", source, 255, 255, 255, true ) setAccountData( account,"Money", tonumber( getAccountData( account,"Money" ) or 0 ) + thirdMoney ) setAccountData( account,"Money", tonumber( getAccountData( account,"Money" ) or 0 ) + 1 ) elseif (rank >= 3) then setAccountData( account, "Race Loses", tonumber( getAccountData( account,"Race Loses" or 0 ) )+1 ) outputChatBox ( "#FFA824 You lost. I wish you luck in the next round. Sorry , no points for you , but you won "..tostring(anotherMoney).." for being on the "..tostring(rank).."th place.", source, 255, 255, 255, true ) setAccountData( account,"Money", tonumber( getAccountData( account,"Money" ) or 0 ) + anotherMoney ) end end end addEventHandler( "onPlayerWasted",root,DestructionWin )
  9. You want to set the player team and remove HIS account when he presses on "servergroup_assigned"?
  10. Castillo

    DX not working

    Would be helpful if you post your debug.
  11. What do you mean by "remove his a account"?
  12. Castillo

    Problems

    What do you mean? show us the errors.
  13. Castillo

    Noob problem

    You're talking about radar areas maybe? createRadarArea
  14. Castillo

    Object Limit

    viewtopic.php?f=91&t=38690&p=398037
  15. Are they really there? and you're using that server? Example: I have many server folders, the place where maps are saved for me, isn't the same server I use for testing purposes.
  16. @Draken: Why would he create the vehicles via createVehicle? he can just get all vehicles after the map has loaded and freeze them. @Cx.83: Check one of the 'stealth' game mode maps, it has what you're looking for.
  17. Oh, I don't know then, because basemode is all compiled, so you can't edit it.
  18. You can use spawnPlayer to spawn a player.
  19. Simplemente no podran cambiarse de nombre.
  20. You're welcome. Topic locked.
  21. I'm afraid you haven't understood me, I meant to store every trailer on a table. E.g: local trailers = {} addEventHandler("onPlayerJoin",root, function () trailers[source] = {} end ) Then you can do something like this: trailers[source][1] = createVehicle(arguments...)
  22. I'm afraid I don't understand what are you trying to do.
  23. 1): Para hacer cualquier tipo de script necesitas aprender a programar en Lua. https://wiki.multitheftauto.com/wiki/ES/ ... %B3n_a_Lua https://wiki.multitheftauto.com/wiki/ES/ ... B3n_de_GUI 2): No podes ver las contraseñas de los usuarios, eso seria abuso.
  24. Try it with a normal ped, not a zombie and see if it works.
×
×
  • Create New...