-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You have to check when a player dies if alive players left are 1 and then that's the winner.
-
function setPlayerStats(thePlayer) local account = getPlayerAccount(thePlayer) if (account and not isGuestAccount(account)) then setAccountData(account,"kills",0) setAccountData(account,"headshots",0) setAccountData(account,"deaths",0) outputChatBox("[sTATS]".. getPlayerName(thePlayer) .."'s has resetted his/her stats to 0!", getRootElement(), 50, 255, 0) end end addCommandHandler("cs",setPlayerStats)
-
addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(152,79,519,494,"BKZ| Sistema de Musica",false) GUIEditor_Image[1] = guiCreateStaticImage(0.2293,0.0607,0.5453,0.0911,"shruk.png",true,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(0.0443,0.1943,0.2543,0.1275,"Pump It",true,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(0.3776,0.1964,0.2543,0.1275,"una vaina loca",true,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(0.6917,0.1943,0.2543,0.1275,"sexy Bitch",true,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(0.0462,0.3765,0.2543,0.1275,"Sexo sudor y calor",true,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(0.3796,0.3826,0.2543,0.1275,"hola beba",true,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(0.738,0.8806,0.2447,0.1012,"CERRAR",true,GUIEditor_Window[1]) showCursor(true) end ) addEventHandler("onClientGUIClick", root, function () if ( source == GUIEditor_Button[1] ) then sound = playSound( "http://escapadehigh.com/Stuff/Pump.mp3", false ) elseif ( source == GUIEditor_Button[2] ) then sound = playSound( "http://tubefot.com/discografias/farruko/Fuego%20Ft.%20Farruko%20-%20Una%20Vaina%20Loca%20(Official%20Remix)%20%20([url=http://WWW.ELGENERO.COM]WWW.ELGENERO.COM[/url]).mp3", false ) elseif ( source == GUIEditor_Button[3] ) then sound = playSound( "http://spm77.free.fr/Music/David%20Guetta%20-%20One%20More%20Love%20(2010)%20-%20Dance/103-david_guetta_feat_akon-sexy_bitch.mp3", false ) elseif ( source == GUIEditor_Button[4] ) then sound = playSound( "http://mp3.hhgroups.com/descargar-tema/Shamanes%20Crew%20-%20Shamanes%20junto%20a%20ti%20-%20www.HHGroups.com.mp3", false ) elseif ( source == GUIEditor_Button[5] ) then sound = playSound( "http://dc437.4shared.com/img/1082416795/657d267e/dlink__2Fdownload_2FzqOaM5Nj_3Ftsid_3D00000000-000000-00000000/preview.mp3", false ) elseif ( source == GUIEditor_Button[6] ) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end )
-
That'll never work. You can do this: addEventHandler("onClientGUIClick",root, function () if ( source == getControl(wndCreateVehicle,"vehicles") ) then for row=0, guiGridListGetRowCount(getControl(wndCreateVehicle, "vehicles")) do guiGridListSetItemColor(getControl(wndCreateVehicle, "vehicles"),row,1,0,255,0) end end end ) It'll set the all grid list rows to green.
-
function setData( ) local country = call( getResourceFromName( "admin" ), "getPlayerCountry", source ) local account = getPlayerAccount( source ) local ip = getPlayerIP ( source ) local serial = getPlayerSerial ( source ) if isGuestAccount( account ) then outputChatBox( "#FFA824*You aren't logged in!", source, 255, 12, 15, true ) setElementData ( source, "Ratio" , 0 ) setElementData ( source, "Race Wins" , 0 ) setElementData ( source, "Race Loses" , 0 ) setElementData ( source, "Country" , country ) setElementData ( source, "Points" , 0 ) setElementData ( source, "Money" , 0 ) setElementData ( source, "IP" , ip ) setElementData ( source, "Serial" , serial ) triggerClientEvent( source,"setText", source ) else local wins = getAccountData( account, "Race Wins" ) or 0 local money = getAccountData( account, "Money" ) or 0 local points = getAccountData( account, "Points" ) or 0 local loses = getAccountData( account, "Race Loses" ) or 0 local ratio = math.max( 0, math.min( 100, math.floor( wins / ( loses + wins ) * 100 ) ) ) or 0 setElementData ( source, "Ratio" , ratio ) setElementData ( source, "Race Wins" , wins ) setElementData ( source, "Race Loses" , loses ) setElementData ( source, "Country" , country ) setElementData ( source, "Points" , points ) setElementData ( source, "Money" , money ) triggerClientEvent( source,"setText",source ) end end addEvent( "onPlayerShowWindow", true ) addEventHandler( "onPlayerShowWindow", root, setData)
-
Well, then it's time to learn.
-
Just get the value and do what you want, and then update the SQL value.
-
getPlayerAccount -- To get player account. setAccountData -- To save the time on his account. getAccountData -- To obtain the saved time from his account. getElementData -- To get player time. setElementData -- To set player time.
-
I'm just confused, what is this Skype group? for what?
-
1): local alienX, alienY, alienZ = 0, 0, 5 local humanX, humanY, humanZ = 0, 0, 10 addEventHandler("onPlayerWasted",root, function () if (getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) == "Alien") then setTimer(spawnPlayer, 1000, 1, source, alienX, alienY, alienZ) elseif (getPlayerTeam(source) and getTeamName(getPlayerTeam(source)) == "Human") then setTimer(spawnPlayer, 1000, 1, source, humanX, humanY, humanZ) end end ) 2): function FPSStop () if isElement(Body) then destroyElement(Body) end setElementAlpha( getLocalPlayer(), 255) setCameraTarget (getLocalPlayer()) end addEventHandler ( "onClientResourceStop", resourceRoot, FPSStop) function shakeCamera(weapon) x,y,z = getPedBonePosition ( getLocalPlayer(), 26 ) if weapon == 24 then createExplosion ( x,y,z + 10,12,false,0.4,false) elseif weapon == 25 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 26 then createExplosion ( x,y,z + 10,12,false,0.7,false) elseif weapon == 27 then createExplosion ( x,y,z + 10,12,false,0.5,false) elseif weapon == 29 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 30 then createExplosion ( x,y,z+10,12,false,0.2,false) elseif weapon == 31 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 33 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 34 then createExplosion ( x,y,z + 10,12,false,0.3,false) elseif weapon == 22 then createExplosion ( x,y,z + 10,12,false,0.1,false) elseif weapon == 28 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 32 then createExplosion ( x,y,z + 10,12,false,0.2,false) elseif weapon == 38 then createExplosion ( x,y,z + 10,12,false,0.6,false) end end addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), shakeCamera ) function carcheck(player) if player == getLocalPlayer() then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) setElementCollisionsEnabled(Body, false) setElementAlpha(getLocalPlayer(), 255) end end addEventHandler ( "onClientVehicleStartEnter", getRootElement(), carcheck ) function checkCarTask() local stask = getPedSimplestTask(getLocalPlayer()) if (stask == "TASK_SIMPLE_CAR_GET_IN") or (stask == "TASK_SIMPLE_GO_TO_POINT") or (stask == "TASK_SIMPLE_CAR_OPEN_DOOR_FROM_OUTSIDE") or (stask == "TASK_SIMPLE_CAR_ALIGN") or (stask == "TASK_SIMPLE_CAR_CLOSE_DOOR_FROM_INSIDE") or (stask == "TASK_SIMPLE_CAR_SHUFFLE") or (stask == "TASK_SIMPLE_CAR_DRIVE") or (stask == "TASK_SIMPLE_ACHIEVE_HEADING") then abortCarEnterCheck = setTimer ( checkCarTask, 100, 1 ) elseif (isPedInVehicle(getLocalPlayer()) == false) then --enter vehicle was aborted setElementCollisionsEnabled(Body, true) setElementAlpha(getLocalPlayer(), 0) end end function carexit(player) if player == getLocalPlayer() then setElementCollisionsEnabled(Body, true) setElementAlpha(getLocalPlayer(), 0) end end addEventHandler ( "onClientVehicleExit", getRootElement(), carexit ) function FPSStart () if (not isElement(Body)) then local x,y,z = getElementPosition( getLocalPlayer() ) Body = createObject (983, x, y, z ) attachElements ( Body, getLocalPlayer(), 0, -0.1, 0.45, 90, 0, 90) setElementAlpha( Body, 0) setTimer ( setElementAlpha,1000, 1, getLocalPlayer(), 0) else FPSStop() end end addCommandHandler( "fps", FPSStart )
-
addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(152,79,519,494,"BKZ| Sistema de Musica",false) GUIEditor_Image[1] = guiCreateStaticImage(0.2293,0.0607,0.5453,0.0911,"shruk.png",true,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(0.0443,0.1943,0.2543,0.1275,"Pump It",true,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(0.3776,0.1964,0.2543,0.1275,"una vaina loca",true,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(0.6917,0.1943,0.2543,0.1275,"sexy Bitch",true,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(0.0462,0.3765,0.2543,0.1275,"Sexo sudor y calor",true,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(0.3796,0.3826,0.2543,0.1275,"hola beba",true,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(0.738,0.8806,0.2447,0.1012,"CERRAR",true,GUIEditor_Window[1]) showCursor(true) end ) addEventHandler("onClientGUIClick", root, function () if ( source == GUIEditor_Button[1] ) then -- hacer algo elseif ( source == GUIEditor_Button[2] ) then -- hacer algo elseif ( source == GUIEditor_Button[3] ) then -- hacer algo elseif ( source == GUIEditor_Button[4] ) then -- hacer algo elseif ( source == GUIEditor_Button[5] ) then -- hacer algo elseif ( source == GUIEditor_Button[6] ) then guiSetVisible(GUIEditor_Window[1], false) showCursor(false) end end )
-
This is not CIT server forums, go to: http://cit2.net.
-
I think this post should be moved to: viewforum.php?f=67
-
Que yo sepa no se puede.
-
Colshapes are invisible, you can only see them by /showcol with setDevelopmentMode enabled.
-
El quiere que se reproduzca cuando el recurso se termine de descargar.
-
La URL es invalida, fijate en la consola de F8 te da un error:
-
Va a poner el sonido despues de que el recurso se descargue.
-
@Yakuza: Eso no tiene sentido, porque simplemente no usar onClientResourceStart que es cuando el recurso se descarga. addEventHandler("onClientResourceStart", resourceRoot, function () playSound("http://dkclanmta.jimdo.com/app/download/5969692782/4f52b6c0/4adbbe46f65187db4272e82b08d50f17219c717f/FREE+DJ+SOUNDEFFECTS+DOWNLOAD+VOL.2+-+YouTube.mp3?t=1330820796", false) end )
-
I guess so, but why you create a table for each player?
-
function newClothes(acc, clothes) return executeSQLUpdate("clothes", "clothes = '".. clothes .."'", "acc = '".. acc .."'" ) end