-
Posts
378 -
Joined
-
Last visited
Everything posted by BriGhtx3
-
Fixed Problem. GuiEditor_Label had to be defined.
-
Yes MySQL. Or temporarly : setElementData
-
function saveTo() local serial = getPlayerSerial(source) local score = getPlayerName(source) local nazwa = getPlayerName(source) local skin = getElementModel(source) local kasa = getPlayerMoney(source) con = mysql_connect ( "127.0.0.1", "****", "****", "****") local res = mysql_query(con, "SELECT serial FROM gracze WHERE serial='"..serial.."'" ) if mysql_num_rows(res) >= 1 then mysql_query ( con, "UPDATE gracze SET serial='"..serial.."', nazwa='"..nazwa.."', score="..score..", skin="..skin..", kasa="..kasa.." WHERE serial='"..serial.."'" ) else mysql_query ( con, "INSERT INTO gracze VALUES ('"..serial.."', '"..nazwa.."', "..score..", "..skin..", "..kasa..")" ) end end
-
server : function blitzer(hitElement, matchingDimension) speedx, speedy, speedz = getElementVelocity (hitElement) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) kmh = actualspeed * 180 geld = kmh/100*200 triggerClientEvent(hitElement,"onStrafe", getRootElement(), kmh, geld) end client : function StrafHandler ( gesch, money ) img = guiCreateStaticImage(392,0,407,268,"Blitzer/Blitzer.png",false) guiSetAlpha(img,0.89999997615814) GUIEditor_Label[3] = guiCreateLabel(741,137,46,30,gesch,false,img) guiLabelSetColor(GUIEditor_Label[3],0,0,0) guiSetFont(GUIEditor_Label[3],"sa-header") end addEvent( "onStrafe", true ) addEventHandler( "onStrafe", getRootElement(), StrafHandler ) Why doesn't it work? Server triggered client-side Event, but event is not added clientside.
-
No i don't think so. But you can adjust it : local screenwidth, screenheight = guiGetScreenSize () if screenwidth == 1440 then gImage["img"] = guiCreateStaticImage(screenwidth-130,120,5,18,"images/img.bmp",false) else gImage["img"] = guiCreateStaticImage(screenwidth-211,0+10,5,18,"images/img.bmp",false) end
-
then (screenX-100) for example?
-
Errors please
-
How about changing player to playerElement? That is your script you should adapt it.
-
function pushHisFreakingAss (playerSource, command, arg1) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if not getElementData ( player, "commandTimer" ) then if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end setElementData ( player, "commandTimer", true ) setTimer ( setElementData, 60000, 1, player, "commandTimer", false ) else outputChatBox ( "You need to wait 60 seconds until executing the command again!", 125, 0, 0 ) end end end end addCommandHandler("push", pushHisFreakingAss) This should be the first function. Now understand this and put it in your codes
-
How about thinking a bit on your own? In the functions, and the text has to be between the if not.. and else
-
if not getElementData ( player, "commandTimer" ) then setElementData ( player, "commandTimer", true ) setTimer ( setElementData, 60000, 1, player, "commandTimer", false ) else outputChatBox ( "You need to wait 60 seconds until executing the command again!", 125, 0, 0 ) end
-
Oh ok. I wrote it already in my posts before but : It is valid. The file exists or it would ouput an error in my meta.
-
Bad 'vehicle' pointer : function startJob(thePlayer) controller = getVehicleController ( --[[What do I have to put in?]] ) Edit : Oh ok I got it, I have to put in the vehicle. But I have no variable for the vehicle oO local vehicle = getPlayerOccupiedVehicle( thePlayer ) local controller = getVehicleController ( vehicle ) Is that right? Cause when I output it it says "Bad argument at outputChatBox"
-
function startJob(thePlayer) local pl = getPlayerName(thePlayer) outputChatBox(thePlayer) HalteNr1 = createMarker ( -2435, -595, 132, "checkpoint", 10, 125, 0, 0, 255, thePlayer ) HalteNr1B = createBlip ( -2435, -595, 132, 0, 2, 255, 0, 0, 255, 0, 99999.0,thePlayer ) triggerClientEvent ( thePlayer, "LTR", getRootElement() ) triggerClientEvent (thePlayer, "infobox_start", getRootElement(), "\nDienst gestartet!", 5000, 125, 0, 0 ) addEventHandler("onMarkerHit", HalteNr1, cMarker) unbindKey ( thePlayer, "sub_mission", "down", startJob ) end local HalteNr2 function cMarker(thePlayer) local money = vioGetElementData(thePlayer, "money") vioSetElementData ( thePlayer, "money", tonumber(money)+50 ) givePlayerMoney(thePlayer, 50) destroyElement(HalteNr1B) destroyElement(HalteNr1) triggerClientEvent ( thePlayer, "Schrott", getRootElement() ) triggerClientEvent ( thePlayer, "N", getRootElement() ) HalteNr2 = createMarker ( -1923, -1785, 32, "checkpoint", 10, 125, 0, 0, 255, thePlayer ) HalteNr2B = createBlip ( -1923, -1785, 32, 0, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer ) addEventHandler("onMarkerHit", HalteNr2, dMarker) end
-
Nope your code is not correct. I know that it is getElementData, but this is a own function/command! vio... is right! Then bindkey is also correct because it first starts startJob and that executes cMarker. But I think you don't get the question. I asked why it outputs it to all players in the bus.
-
local HalteNr2 function cMarker(thePlayer) local money = vioGetElementData(thePlayer, "money") vioSetElementData ( thePlayer, "money", tonumber(money)+50 ) givePlayerMoney(thePlayer, 50) destroyElement(HalteNr1B) destroyElement(HalteNr1) triggerClientEvent ( thePlayer, "Schrott", getRootElement() ) triggerClientEvent ( thePlayer, "N", getRootElement() ) HalteNr2 = createMarker ( -1923, -1785, 32, "checkpoint", 10, 125, 0, 0, 255, thePlayer ) HalteNr2B = createBlip ( -1923, -1785, 32, 0, 2, 255, 0, 0, 255, 0, 99999.0, thePlayer ) addEventHandler("onMarkerHit", HalteNr2, dMarker) end I want that the markers are just shown to the driver. Also just the driver should get the money. I start the function with : bindKey ( thePlayer, "sub_mission", "down", startJob )
-
1. "N" 2. Yes and it can be played in VLC because it is a .ogg and "N" executes also a .ogg file. 3. Yes there aren't any errors concerning this script
-
local passenger = getVehicleOccupant( source, 1 ) takePlayerMoney ( passenger, 100 ) He takes the money of the player in seat 1. But I want that he takes money of ALL in the bus except of the Driver. The driver should get 100.
-
Edit : Didn't see the local sorry
-
There isn't any sound at all when I press F3. Also there isn't any marker or something else.
-
function enterVehicle ( thePlayer, seat, jacked ) local passenger = getVehicleOccupant( source, 1 ) local preis = 100 if busVehicles[getElementModel ( source )] then if seat == 0 then if vioGetElementData ( thePlayer, "job" ) == "busfahrer" then bindKey ( thePlayer, "sub_mission", "down", startJob ) triggerClientEvent ( thePlayer, "infobox_start", getRootElement(), "\nDruecke die spezial-\nmissionen-Taste,\num in den Dienst\nzu gehen!", 5000, 125, 0, 0 ) else triggerClientEvent ( thePlayer, "infobox_start", getRootElement(), "\nDu bist kein Busfahrer!", 5000, 125, 0, 0 ) end end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle )
-
bindKey ( thePlayer, "sub_mission", "down", startJob )
