Jump to content

Maurize

Members
  • Posts

    226
  • Joined

  • Last visited

Everything posted by Maurize

  1. addCommandHandler( "sms", function( player, cmd, name, text ) local target = getPlayerFromName( name ) if ( target ) and ( text ) then outputChatBox( getPlayerName( player ).." sendet: "..text..".", target, 0, 200, 200 ) outputChatBox( "SMS erfolgreich gesendet an "..name..".", player, 0, 200, 200 ) end end ) No words. Self-explain. Need to get function variable for text... If I use "text", it only gets the first word of the sms text message. So I know you know how to solve this!(:
  2. Hey, is there a function or something to remove the color code of a players username?
  3. Yep exactly what i meant! Nice my punk ped is following me and if i hurt him he becames insane and beat the shit out of me:D my own "zombie" resource:D Thanks friends youre the best!
  4. something like that? addEventHandler( "onClientPedDamage", getRootElement(), function( attacker ) if ( attacker ) then local helperPed = getPlayerHelper( attacker ) setTimer( function() local posX1, posY1, posZ1 = getElementPosition( attacker ) local posX2, posY2, posZ2 = getElementPosition( helperPed ) setPedRotation( helperPed, findRotation( posX1, posY1, posX2, posY2 ) - 180 ) setPedAimTarget( helperPed, posX1, posY1, posZ1 ) setPedControlState( helperPed, "fire", true ) setPedControlState( helperPed, "fire", false ) end, 1000, 5 ) end end )
  5. addEventHandler( "onClientPedDamage", getRootElement(), function( attacker, weapon ) if ( attacker ) and ( weapon < 22 ) then local helperPed = getPlayerHelper( getLocalPlayer() ) setPedControlState( helperPed, "fire", true ) end cancelEvent() end ) but if he gets hurt he only shoot one time.. the other times he doesnt?
  6. exactly what I've searched for. Works really good!(: Thanks & now im studying this function to script it for myself in future!(:
  7. I know. But I mean to rotate it arround the object. So the "roll" argument won't be the right thing, I think. I must calculate the x and y position...
  8. So I'm trying to let the camera rotate at a specific object( means x, y and z coordinate ) with setCameraMatrix and onClientRender. Anybody a hint how to let camera rotate at this coordinates? I mean, I only have to update this: setCameraMatrix( this, this, this, this not( x ), this not( y ), this not( z ) ) Thanks!(:
  9. Mate, your script make sense and works like a boss. THANKS YOU SO MUCH SOLIDSNAKE & THE OTHERS WHO TRIED TO HELP, TOO!
  10. @xshadow: U Serious? if ( guiGridListGetSelectedItem) then ( guiElement2 )(guiElement) (guiElemen) ( guiGridListGetSelectedItem)( guiElement2 ) if (guiElement) and (guiElement6) then @jaysds1: the point is, that i want to get the animations out of a table and the create a row for every animation. then select it from list and trigger it.. so guiElement and not guiElement
  11. da fuck is wrong in this line? i mean, this is the syntax or not? if ( guiGridListGetSelectedItem( guiElement2 ) == guiElement[i], guiElement5 ) and ( guiGridListGetSelectedItem( guiElement2 ) == guiElement[i], guiElement6 ) then
  12. YOU should learn more about LUA, too. Still same errors like before 5 posts. Only asked if someone can help me with tables, cause im Learning it. Indeed thanks. guiGridListSetItemText( guiElement2, aHGUI[index], guiElement5, aAnims[i][1], false, false ) -- index thing is nil value
  13. noop, still errors... exactly here: guiGridListSetItemText( guiElement2, guiElement5, guiElement..""..i, animations[i][1], false, false )
  14. theFuck? it is an array? i mean means the number, which is choosen in the loop!
  15. thanks! saw that:) maybe someone else? Jaysds or Castillo?:DD:D
  16. wtf. doesnt look good? u sure that this is correct at all? guiElement = guiGridListAddRow( guiElement2 ) // attempt to index global "guiElement" a nil value
  17. so, i've tried to create a nice and smart animation gui... but now there are these table problems... check it yourself: local animations = { { "RIOT", "RIOT_ANGRY" }, { "RIOT", "RIOT_ANGRY_B" }, { "RIOT", "RIOT_challenge" }, { "RIOT", "RIOT_CHANT" }, { "RIOT", "RIOT_FUKU" }, { "RIOT", "RIOT_PUNCHES" }, { "RIOT", "RIOT_shout" } } bindKey( "i", "down", function() if ( guiGetVisible( guiElement1 ) == false ) then guiSetVisible( guiElement1, true ) showCursor( true ) end end ) addEventHandler( "onClientResourceStart", resourceRoot, function() for i = 1, #animations do guiElement[i] = guiGridListAddRow( guiElement2 ) guiGridListSetItemText( guiElement2, guiElement5, guiElement..""..i, animations[i][1], false, false ) guiGridListSetItemText( guiElement2, guiElement6, guiElement..""..i, animations[i][2], false, false ) end end ) addEventHandler( "onClientGUIClick", elementGroup, function() if ( source == guiElement3 ) then if ( guiGridListGetSelectedItem( guiElement2 ) == guiElement[i], guiElement5 ) and ( guiGridListGetSelectedItem( guiElement2 ) == guiElement[i], guiElement6 ) then local block = guiGridListGetItemText( guiElement2, guiGridListGetSelectedItem( guiElement2 ), guiElement5 ) local animation = guiGridListGetItemText( guiElement2, guiGridListGetSelectedItem( guiElement2 ), guiElement6 ) if ( block ) and ( animation ) then triggerServerEvent( "onElementAnimation", elementPlayer, block, animation ) end end elseif ( source == guiElement4 ) then guiSetVisible( guiElement1, false ) showCursor( false ) end end )
  18. I solved problems:) i've triggered the data from server at spawn, so the data is already here if he opens the first time. So EVERYTHING WORKS! Good job! Jaysds1 as always, you are the best! And castillo, you of cause, too! Thanks alot!
  19. nice one:D data is now a string with random letters and numbers:D fuck, this shit is complicated as hell!
  20. both are buggy... unexpected symbol near jaysds tostring( .. ) things and castillo, yours is buggy, too -> "attempt to concantenate global "pMax" a nil value" .. :> addEvent( "onElementDataInfos", true ) bindKey( "tab", "both", function() if ( guiGetVisible( guiElement1 ) == false ) then guiSetVisible( guiElement1, true ) guiGridListClear(guiElement2) triggerServerEvent( "onElementDataServer", elementPlayer ) addEventHandler( "onElementDataInfos", elementPlayer, function( playerOnline, playerMax, playerPolice, playerBallas, playerAdmins, resourceVersion ) pOnline = playerOnline pMax = playerMax pPolice = playerPolice pBallas = playerBallas pAdmins = playerAdmins rVersion = resourceVersion end ) guiSetText( guiElement3, pOnline.."/"..pMax.." Spieler online!" ) guiSetText( guiElement4, #pPolice.." Polizisten online!" ) guiSetText( guiElement5, #pBallas.." Ballas online!" ) guiSetText( guiElement6, #pAdmins.." Admins online!" ) guiSetText( guiElement7, "Resource Version: "..rVersion ) for id, player in ipairs( getElementsByType( "player" ) ) do triggerServerEvent( "onElementDataUpdate", player ) if ( getElementData( player, "listData1" ) > 0 ) then wanteds = getElementData( player, "listData1" ) else wanteds = 0 end local guiElement12 = guiGridListAddRow( guiElement2 ) guiGridListSetItemText( guiElement2, guiElement12, guiElement9, getPlayerName( player ), false, false ) guiGridListSetItemText( guiElement2, guiElement12, guiElement10, getElementData( player, "listData1" ), false, false ) guiGridListSetItemText( guiElement2, guiElement12, guiElement11, getPlayerPing( player ), false, false ) end else guiSetVisible( guiElement1, false ) end end ) -- fixed some formal things.
  21. It's much better to create functions like "getDatabase( element, "row" ) and setDatabase( element, "row", value ) to handle database and have a smart use. if u have any questions or need help simply write a message and i will help you:)
  22. so far so good... now it seems to be a problem client side.. addEvent( "onElementDataInfos", true ) bindKey( "tab", "both", function() if ( guiGetVisible( guiElement1 ) == false ) then guiSetVisible( guiElement1, true ) guiGridListClear(guiElement2) triggerServerEvent( "onElementDataServer", elementPlayer ) addEventHandler( "onElementDataInfos", elementPlayer, function( playerOnline, playerMax, playerPolice, playerBallas, playerAdmins, resourceVersion ) pOnline = playerOnline pMax = playerMax pPolice = playerPolice pBallas = playerBallas pAdmins = playerAdmins rVersion = resourceVersion end ) guiSetText( guiElement3, pOnline.."/"..pMax.." Spieler online!" ) guiSetText( guiElement4, pPolice.." Polizisten online!" ) guiSetText( guiElement5, pBallas.." Ballas online!" ) guiSetText( guiElement6, pAdmins.." Admins online!" ) guiSetText( guiElement7, "Resource Version: "..rVersion ) for id, player in ipairs( getElementsByType( "player" ) ) do triggerServerEvent( "onElementDataUpdate", player ) if ( getElementData( player, "listData1" ) > 0 ) then wanteds = getElementData( player, "listData1" ) else wanteds = 0 end local guiElement12 = guiGridListAddRow( guiElement2 ) guiGridListSetItemText( guiElement2, guiElement12, guiElement9, getPlayerName( player ), false, false ) guiGridListSetItemText( guiElement2, guiElement12, guiElement10, getElementData( player, "listData1" ), false, false ) guiGridListSetItemText( guiElement2, guiElement12, guiElement11, getPlayerPing( player ), false, false ) end else guiSetVisible( guiElement1, false ) end end ) "attempt to concantenate global "pMax" a nil value" .... any hints or something? btw u are a big help, mates! EDIT: if i press twice. first bug is gone but new one arrives... ( attempt to concantenate global "pPolice" a table value )
  23. maybe a shorter way? check this so u see what i mean:) addEvent( "onElementDataServer", true ) addEventHandler( "onElementDataServer", elementPlayer, function() local playerOnline = getPlayerCount() local playerMax = getMaxPlayers() local players = getElementsByType( "player" ) for i, v in ipairs( players ) do if ( getDatabase( v, "Fraktion" ) == 1 ) then playerPolice = elseif ( getDatabase( v, "Fraktion" ) == 2 ) then playerBallas = end if ( getDatabase( v, "Admin" ) > 0 ) then playerAdmins = end end local resourceVersion = getResourceInfo( resourceRoot, "version" ) triggerClientEvent( "onElementDataInfos", source, playerOnline, playerMax, playerPolice, playerBallas, playerAdmins, resourceVersion ) end end )
×
×
  • Create New...