-
Posts
378 -
Joined
-
Last visited
Everything posted by BriGhtx3
-
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
-
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.
-
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
-
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)
-
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
-
GanJa your code will not work. playerVehicle is a ped now
-
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 )
-
Haha No normally I'm not rude Just wanted to "show" him that it is wrong ;D
-
Timiit cause its serverside. Just change the onPlayerVehicleEnter to onClientPlayerVehicleEnter
-
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
-
Because player is an element, and not a name Sorry my mistake. function damage(player) setVehicleDamageProof(getPedOccupiedVehicle(player),true) end addCommandHandler("proofme",damage)
-
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
-
show the whole function
-
function anc(player,cmd,target) if target then pTarget = getPlayerFromName(target) setElementData(pTarget,"abc",true) end end
-
What do you want now You have to be presicer.
-
You can also just use SQL oO
-
and the timer in line 8 is totally wrong. You need arguments for the function!
-
This script is totally confusing Why do you render the same event twice?
-
replace the line if isPlayerInTeam(hitElement, "Police") then with if getPlayerTeam(hitElement) == "Police" then
-
warpPedIntoVehicle(thePlayer,Masina)
-
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
