-
Posts
168 -
Joined
-
Last visited
Everything posted by Wisam
-
Hello.. Im writing this to talk about a prone animation for mta which allows the player to prone like this guy in the photo and will be able to shoot and move.. or atleast shoot, so i will try to script it i just need help with the functions, events.. etc i need it for my DayZ server Before i though it was impossible till i saw this.. please if you know anything that can help me post here Thank you in advance
-
Thanks alot all for your help, and Castillo :3, i should have deleted the scripts
-
Hey, i needed some help in this turret script.. i added a price for the turret (20000) first and it kinda worked but when the player have 0$ money he can buy a turret but his money become negative and he can keep buying, so i added: RESOLVED AND DELETED
-
I dont think he mean that, even if he change the volume.. all the players in the server can hear it
-
I have a small team friendly fire script it makes the fire unharmful for teammates, and i wanted to add a new feature, its teammates cant damage each other's vehicles (when its being driven) Script: function protect() for i, TEAMS in ipairs ( getElementsByType("team") ) do if ( getTeamFriendlyFire ( TEAMS ) == true ) then setTeamFriendlyFire ( TEAMS, false ) end end end addEventHandler("onResourceStart", resourceRoot, protect)
-
Thank you alot both, best mta scripters
-
There is an easier way, i can put the givePlayerMoney in my login/register script at the function which creates an account(addAccount) in the client side, you think this gonna work?!
-
Hey, Im now starting to learn scripting and its going well, but i wanted to know one event that could be very useful and its the player register event, i searched the wiki trying to find an event like onPlayerRegister cause i tryed to make a script that gives the player amount of money when he register.. i also tryed getAccount, getAccountData and onPlayerLogin but i could't figure it out Can you please help me?!
-
I got here a script which if a player kills anyone he get extra ammo for the weapon he killed with it wokrs perfectly, and i wanted to add a small thing which is when the ammo increase a dxtext message will appear on the screen for a few seconds, This is server side, i know i need a client side for the dxtext so i tryed to complete the function but because im new at lua i couldn't complete it: Script: Server local weaponA = { [22] = 17, -- Pistol [23] = 17, -- Silinced Pistol [24] = 7, -- Desert Eagle [25] = 10, -- Shotgun [27] = 7, -- SPAZ-12 Combat Shotgun [29] = 30,-- MP5 [30] = 50, -- AK-47 [31] = 50, -- M4 [33] = 10, -- Country Rifle [34] = 7 -- Sniper Rifle } function playerWasted(_, attacker, weapon) if attacker and attacker ~= source and getElementType(attacker) == "player" then if weaponA[weapon] then giveWeapon(attacker, weapon, weaponA[weapon]) end end end addEventHandler("onPlayerWasted", root, playerWasted) Client: setTimer( function weaponA( ) if isElement (attacker) then dxDrawText("+Ammo", 823, 198, 1015, 242, tocolor(0, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, true, false, false) end end ,3000, 1 ) addEventHandler("onPlayerWasted", root, playerWasted)
-
You don't understand, the key is already bound which is the team select menu, now players abuse it by pressing it when they're dead so they dont have to wait for the spawn time.. and i want to unbind it only for 15 seconds(until they spawn)
-
Didnt work, players sill press F3 when dead
-
HEy I wanted to make somthing for my server and its a bug that can be easly abused and ill try to fix it, so my server have assault gamemode and the bug abuse is when the player is dead he should wait 15 seconds to respawn(10seconds killcam) and the way players abuse it that when they die they just click F3(to return to team select menu) and join a team.. so they dont wait 15 seconds. What i want to do is to disable the F3 command(team select menu) UNTIL the player spawns The onPlayerWasted function: Server function onPlayerWasted( ammo, attacker, weapon, bodypart ) destroyBlipsAttachedTo(source) if (noMapLoaded == false) then if (getElementDataLocal( source, "dontRespawn" ) == true) then setElementDataLocal( source, "dontRespawn", false ) --outputDebugString("not spawning player") else if (waiting == true) then --outputDebugString("waiting for start") waitForStart( source ) else --outputDebugString("spawning player") setTimer( spawnPlayerTeam, 15000, 1, source ) pointsOnPlayerWasted(source, ammo, attacker) end end end end And i just added this below pointsOnPlayerWasted: setTimer( unbindKey ( source, "F3", "down", "spawnScreen" ) ,15000,1 ) I got WARNING: assault\assault.lua:911: Bad argument @ 'setTimer' [Expected function at argument 1, got boolean]
-
And you can't trigger built-in events. Cause im new in lua and i only know the basics
-
i really dont know how to do it.. i just wrote small part of it and TAPL helped me! i suck at lua
-
IS this gonna work? Server: local weaponA = { [22] = 17, -- Pistol [23] = 17, -- Silinced Pistol [24] = 7, -- Desert Eagle [25] = 10, -- Shotgun [27] = 7, -- SPAZ-12 Combat Shotgun [29] = 30,-- MP5 [30] = 50, -- AK-47 [31] = 50, -- M4 [33] = 10, -- Country Rifle [34] = 7 -- Sniper Rifle } function playerWasted(_, attacker, weapon) if attacker and attacker ~= source and getElementType(attacker) == "player" then if weaponA[weapon] then giveWeapon(attacker, weapon, weaponA[weapon]) triggerClientEvent( "onPlayerWasted", root, giveWeapon) end end end addEventHandler("onPlayerWasted", root, playerWasted) Client: setTimer( function weaponA( ) if isElement (attacker) then dxDrawText("+Ammo", 823, 198, 1015, 242, tocolor(0, 0, 0, 255), 0.80, "bankgothic", "left", "top", false, false, true, false, false) end end ,3000, 1 )
-
Hey.. So i have a server with Bomb Da Base gamemode(based on assault) and EVRYTHING is working perfectly 99.9%, expect one thing its the votemanager.. im sure you know the assault gammode every map has 2 rounds, but the problem is that i have to keep changing the map manually all the time, there isn't a votemap or a next random map i tryed to fix it but failed.. Myabe i just have to link the votemanager or the mapcycle to the gammode? if you know anything please help me
-
lol story of my life, but now i can script a bit and still learning btw thanks for the tips
-
Fuckin Thank you man, God bless you
-
Hi.. I got here a killcam script my friend made and it works perfectly, i wanted to add a small thing in it i wish you help me with cause as i said before i suck at lua Anyway what i want to do is that the killcam will appear after 5 seconds of the player death, not instantly Script(Client): local player local rx, ry = guiGetScreenSize ( ) addEventHandler ( "onClientPlayerWasted", localPlayer, function ( k ) if ( source ~= localPlayer ) then return end if ( isElement ( k ) and getElementType ( k ) == "player" ) then player = k setCameraTarget ( k ) addEventHandler ( "onClientRender", root, killcam ) setTimer ( function ( ) removeEventHandler ( "onClientRender", root, killcam ) end ,10000, 1 ) end end ) function killcam ( ) if isElement ( player ) then dxDrawText ( "Viewing Kill Cam of " .. getPlayerName ( player ) .. "!", 0, 0, rx, ry, tocolor ( 255, 0, 0, 255 ), 5, "default", "center", "center", false, false, false ) end end
-
Hello.. So i have assault gamemode in my server and i recently had one problem with the maps its when a map ends(2 rounds) a vote map will appear to start a new map, but now the same map keep restarting over and over and the votemap wont appear.. i have the votemap started but nothing happens. and i try to type vote map and it worked but it wont start automatically when the map ends. When i used to make maps and go test them the vote work but now not.. what you think the problem is?!
