Jump to content

BriGhtx3

Members
  • Posts

    378
  • Joined

  • Last visited

Everything posted by BriGhtx3

  1. BriGhtx3

    Lock Help!

    function lockcar ( thePlayer ) playerVehicle = getPedOccupiedVehicle(thePlayer) local isLocked = isVehicleLocked ( playerVehicle ) if ( playerVehicle ) then if isLocked == false then setVehicleLocked ( playerVehicle, true ) outputChatBox( "Vehicle locked!", thePlayer, 255, 50, 0) isLocked = true else setVehicleLocked ( playerVehicle, false ) outputChatBox( "Vehicle unlocked!", thePlayer, 0, 255, 0) isLocked = false end end end function bindLockOnSpawn ( theSpawnpoint ) bindKey ( source, "l", "down", lockcar) end addEventHandler ( "onPlayerSpawn", getRootElement(), bindLockOnSpawn ) This will definitly work
  2. The parameters of the event onPlayerChat are : string message, int messageType messageType 0 means normal message 1 means action message 2 means team chat So if the messageType is NOT 2, we cancel the event.
  3. function kickPlayerHandler (player,cmd,kickedname) if (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler) Remove the not
  4. function Extra (msg,msgType) if msgType ~= 2 then cancelEvent () outputChatBox("You Cant Type in Here Type Team Chat Only",255,255,0) end end addEventHandler( "onPlayerChat", getRootElement(), Extra)
  5. BriGhtx3

    Lock Help!

    He defined isLocked after his bindKey But it wont work, cause its just a local variable €:GanJa you also forgot the source element in your bindKey as argument
  6. BriGhtx3

    Lock Help!

    GanJa your code will not work. playerVehicle is a ped now
  7. BriGhtx3

    Lock Help!

    function lockcar ( thePlayer ) playerVehicle = getPedOccupiedVehicle(thePlayer) local isLocked = isVehicleLocked ( playerVehicle ) if ( playerVehicle ) then if isLocked == false then setVehicleLocked ( playerVehicle, true ) outputChatBox( "Vehicle locked!", thePlayer, 255, 50, 0) isLocked = true else setVehicleLocked ( playerVehicle, false ) outputChatBox( "Vehicle unlocked!", thePlayer, 0, 255, 0) isLocked = false end end end function bindLockOnSpawn ( theSpawnpoint ) bindKey ( source, "l", "down", lockcar, source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), bindLockOnSpawn )
  8. BriGhtx3

    Help me!

    Haha No normally I'm not rude Just wanted to "show" him that it is wrong ;D
  9. BriGhtx3

    Help me!

    Timiit cause its serverside. Just change the onPlayerVehicleEnter to onClientPlayerVehicleEnter
  10. BriGhtx3

    Help me!

    addEventHandler("onPlayerVehicleEnter", getRootElement(), function (theVehicle) addVehicleUpgrade(theVehicle, 1010) end) This is enough. You dont need that whole code Klesh. And the getPedOccupiedVehicle part is dump, cause you enter a car. Also thePlayer is totally wrong cause in your case the thePlayer is a vehicle. I dont want to sound rude, but its rubbish code
  11. Because player is an element, and not a name Sorry my mistake. function damage(player) setVehicleDamageProof(getPedOccupiedVehicle(player),true) end addCommandHandler("proofme",damage)
  12. function damage(player) setVehicleDamageProof(getPedOccupiedVehicle(getPlayerFromName(player)),true) -- theplayer is wrong! it has to be player, like in the brackets of the function end addCommandHandler("proofme",damage) Use this
  13. show the whole function
  14. function anc(player,cmd,target) if target then pTarget = getPlayerFromName(target) setElementData(pTarget,"abc",true) end end
  15. What do you want now You have to be presicer.
  16. You can also just use SQL oO
  17. and the timer in line 8 is totally wrong. You need arguments for the function!
  18. This script is totally confusing Why do you render the same event twice?
  19. replace the line if isPlayerInTeam(hitElement, "Police") then with if getPlayerTeam(hitElement) == "Police" then
  20. warpPedIntoVehicle(thePlayer,Masina)
  21. Hey, I have a table with playernames and wages. Now I want to put all the players in gridlist. How can I do this? I have no code, cause I dont even know how to start. I dont want a whole code, a few tips are enough €: Got it If someone has the same problem : result = mysql_query ( handler, "SELECT * FROM workers" ) if( not result) then outputDebugString("Error executing the query: (" .. mysql_errno(handler) .. ") " .. mysql_error(handler)) else if ( mysql_num_rows ( result ) > 0 ) then mitarbeiter = mysql_fetch_assoc ( result ) destinySetData(getPlayerFromName(mitarbeiter["Name"]),"firma","mclaren") destinySetData(getPlayerFromName(mitarbeiter["Name"]),"firmgehalt",mitarbeiter["Gehalt"]) destinySetData(getPlayerFromName(mitarbeiter["Name"]),"chef",mitarbeiter["chef"]) else mysql_free_result ( result ) end end
×
×
  • Create New...