Jump to content

Stubbinz

Member
  • Content Count

    41
  • Joined

  • Last visited

  • Medals

Everything posted by Stubbinz

  1. I'm trying to get an action to show up when the given target is dead. For some reason its not working. this addAction ["Loot","corpse_loot.sqs",false,1,true,true, "?! (alive _target)"]; Anyone care to explain what i'm doing wrong.
  2. Okay, so i have a gun rack with a bunch of actions allocated to it. What these actions do is essentially subtracts the _callers variable of "money" and places a gun in the rack for you to take. So far it works 100% fine, until i have multiplayer going on. Me as the host can still "buy" guns and equip them, however my buddy can not. He can see the actions and select them, and it even subtracts his money. One really weird aspect though, is the fact that it will place the gun in the rack, but only he sees it as I (host comp) can not. He will then try to pick it up and it never switches over to him, just stays in the rack visible to him, invisible to me. Any idea what could be the issue? its giving me a headache. Example buy script. _target = _this select 0; _caller = _this select 1; _id = _this select 2; _money = _caller getvariable ["money",0]; if(_money >= 200) THEN {_target addWeaponCargo ["LeeEnfield",1];_target addMagazineCargo ["10x_303",1];_money=_money-200;} ELSE {Hint "not Enough Cash."}; ~0.125 _caller setvariable ["money",_money]; exit;
  3. Was just wondering if i could have units have their own respawns or is it limited to just teh side using the respawn_west markers?
  4. Quick question, how would i keep the condition between two variables? while {spawn_zeds} do { _player1 = players select 0; _player2 = players select 1; _spawnground_p1 = getpos nearestobject [_player1, "HeliH"]; _spawn_p1 = floor (random 20); _spawn_p2 = floor (random 10); if (_spawn_p1 >= 0) && (_spawn_p1 <= 10) then {_group = createGroup WEST; "US_Soldier_AMG_EP1" createunit [_spawnground_p1,_group,'this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}]', 1, "COLONEL"];}; if (_spawn_p1 >= 11) && (_spawn_p1 <= 20) then {_group1 = createGroup WEST; "GER_Soldier_EP1" createunit [_spawnground_p1,_group1,'this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}]', 1, "COLONEL"];}; sleep (random 10); }; When i remove the condition after the && symbols it spawns the unit, but if the variable is over 11, it spawns both units which i don't want. I want it to spawn one or the other. ---------- Post added at 01:34 AM ---------- Previous post was at 01:26 AM ---------- Nevermind. I'm a tard. ha I realize i gotta have the AND inside the single (condition) area with the conditions. ha
  5. Okay, essentially i have multiplayers but i'm going to explain with _player1. Basically i have a bunch of invisible helipads laid about, and what i want is some zombies (using UNDEAD MOD) to spawn in a random radius around one of these helipad's using nearestobjects. My script im using at the moment doesnt' seem to work, advise appreciated. _player1 = players select 0; _spawnground = getpos nearestobject [_player1, "HeliH"]; while {spawn_zeds} do { _group = createGroup resistance; "CHN_ZOMBIE_Policeman" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Rocker2" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_citizen1" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Citizen2" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Citizen3" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Priest" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], "COLONEL"]; "CHN_ZOMBIE_Profiteer4" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Profiteer3" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Profiteer2" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Profiteer1" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Policeman" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; "CHN_ZOMBIE_Policeman" createunit [_spawnground,__group,this addEventHandler ["killed",{(vehicle (_this select 0)) addAction ["Loot Corpse","corpse_loot.sqs"];}], 1, "COLONEL"]; (leader _group) setpos getpos _spawnground; }; sleep (random 300); };
  6. For example, i have multiple guys with the same variables attached to each, however the variables independently change due to player actions and what not. But i keep getting everyone elses Hints popping up. How do i apply hints to one person specifically? Such as, if one units hunger >= 90 hint "You are starving!" works, but its telling everyone 'You are starving!" I need it to apply to the single person that variable is attached to. What do?
  7. Haha Thank you, i'll test it out if my computer doesnt' explode. Its make a racket right now for some reason, damn youtube videos ha
  8. I have my guy with setvariable ["hunger",90] i have a script thats calls this variable (so i can see how hungry my guy is via hint. That works, however my hunger does not increase, nor decrease with anything im doing. Telling me that the variable is staying constant. How does one work around this? my hunger script. #hungerscript _target = _this select 0; _caller = _this select 1; _id = _this select 2; ~0.125 _hunger = _caller getvariable "hunger"; ~0.125 if (_hunger < 100)THEN {_hunger = _hunger+1} ELSE {player setdamage 1}; ~0.125 if (_hunger >= 90)THEN {hint "You are Starving!} ELSE {}; ~5 _caller setvariable ["hunger",_hunger]; goto "hungerscript"; Exit;
  9. I got it. Thank you guys for the support. :D I've just been su used to using sqs since flashpoint days, so sqf isnt my strong point, but that's why i'm on these forums to begin with. thank you.
  10. Thanks weirdo for the information, however it doesn't really address the problem i'm having trying to fix my hunger issue ha
  11. Still is not working. Funny thing is i have a money variable attached to the unit, and a test script that subtracts its value which seems to be working. Yet, i'm not registering any increase to my hunger value at all as that is supposed to be perpetual in nature. Example, gain +1 hunger every minute or whatever time frame i wanted (going for a minute at the moment). When hunger reaches 100, unit dies. I need it to be compatible for multiplayer, so i cant just use player variable i believe. Its actually really annoying.
  12. Thank you, and yeah, im old school. ha. I don't really know the difference between sqf and sqs very much to be effective with it. ---------- Post added at 11:22 PM ---------- Previous post was at 11:17 PM ---------- And its still not working. ha
  13. I've been on servers where they gave units custom names in the selection lobby. So instead of saying "rifleman" all the time or whatever it may be. It can say "Alpha 6" or "Fruitcup" whatever you wanted. How does one go about doing this?
  14. I can already tell i'd have a problem with the {brackets} ha
  15. Hey guys, i've been searching and doing some trail&error work, and for the life of me i can't figure out why my scripts are running for everyone on my lan games. Even something as simple as spawning a vehicle on a gamelogic position. It spawns at first, but as soon as something interacts with it, another vehicle spawns right on top of it equal to the amount of players playing. My way around this was giving players the option to spawn said vehicle at an ammobox then using modeltoworld etc etc. it will spawn one vehicle. Likewise with another mission, i have a paradrop script that ejects everyone out of a c-130 yet, it spawns an additional empty parachute per player. I can't figure it out. They are really simple scripts and in each mission i have a game logic named server which to my knowledge is supposed to help combat this exact thing. :confused::confused::confused: Any help is appreciated.
  16. Ah, see there is thing i don't know very much about at all, the difference between .sqs files and sqf. Sqf seems very complicated to me. :/ ---------- Post added at 01:33 AM ---------- Previous post was at 01:29 AM ---------- P.S. I'm still used to scripting for Operation Flashpoint. never had a chance to do the first arma, then i got ARMA II and sqf is still very foreign to me.
  17. Oh, im not that much of a newb. ha. I have independents set to opfor friendly in that, and i spawn the units like so. suv1 = "SUV_TK_CIV_EP1" createVehicle (getpos suv_spawn); suv2 = "SUV_TK_CIV_EP1" createVehicle (getpos suv_spawn); suv1 setdir 120; suv2 setdir 120; ~1 _squad = position SUV_spawn; _Grp1 = Creategroup WEST; _leader="TK_Special_Forces_EP1" createUnit [_squad,_Grp1,"this moveindriver suv1",0.5,"Corporal"]; bagent01="Functionary1" createUnit [_squad,_Grp1,"this moveincargo suv1",0.5,"Corporal"]; _Unit2="TK_Special_Forces_EP1" createUnit [_squad,_Grp1,"this moveincargo suv1",0.5,"Corporal"]; _Unit3="TK_Special_Forces_EP1" createUnit [_squad,_Grp1,"this moveincargo suv1",0.5,"Corporal"]; _Unit4="TK_Special_Forces_EP1" createUnit [_squad,_Grp1,"this moveincargo suv2",0.5,"Corporal"]; _unit5="TK_Special_Forces_EP1" createUnit [_squad,_grp1,"this moveindriver suv2",0.5,"Corporal"]; _unit6="TK_Special_Forces_EP1" createUnit [_squad,_grp1,"this moveincargo suv2",0.5,"Corporal"]; ~1 EAST setFriend [RESISTANCE, 1]; RESISTANCE setFriend [EAST, 1]; _WP1 = _grp1 addWaypoint [position suv_route_1, 0]; _WP1 setWaypointType "MOVE"; _WP1 setWaypointBehaviour "safe"; _WP1 setWaypointCombatMode "YELLOW"; _WP1 setWaypointDescription "Truck Secure Team."; _WP1 setWaypointSpeed "NORMAL"; _WP2 = _grp1 addWaypoint [position suv_route_2, 0]; _Wp2 setWaypointType "MOVE"; _WP2 setWaypointBehaviour "safe"; _WP2 setWaypointCombatMode "YELLOW"; _WP2 setWaypointDescription "Truck Secure Team."; _WP2 setWaypointSpeed "NORMAL"; _WP3 = _grp1 addWaypoint [position suv_route_3, 0]; _WP3 setWaypointType "MOVE"; _WP3 setWaypointBehaviour "safe"; _WP3 setWaypointCombatMode "YELLOW"; _WP3 setWaypointDescription "Truck Secure Team."; _WP3 setWaypointSpeed "Normal"; _WP4 = _grp1 addWaypoint [position suv_getout, 30]; _WP4 setWaypointType "GETOUT"; _WP4 setWaypointBehaviour "aware"; _WP4 setWaypointCombatMode "YELLOW"; _WP4 setWaypointDescription "Truck Secure Team."; _WP4 setWaypointSpeed "Normal"; _wp4 setwaypointstatements ["true","fox_1 sidechat 'HQ, targets have stopped and are proceding to search the area. Advise.'; suvdrop = true"]; _WP5 = _grp1 addWaypoint [position suv_town_center, 10]; _WP5 setWaypointType "SAD"; _WP5 setWaypointBehaviour "aware"; _WP5 setWaypointCombatMode "YELLOW"; _WP5 setWaypointDescription "Truck Secure Team."; _WP5 setWaypointSpeed "Normal"; _WP5 setWaypointformation "Diamond"; _wp5 setwaypointstatements ["true AND ? ! alive warlord_shadi","bagent01 globalchat 'Where is Shadi? Look for him!'"]; exit; That's the script i have right now. And when the suv's are following the path, when they run into the first resistance patrol, they get out and fire away and of course the resistance shoots back. Basically i'm trying to make it seem like another nation or group of people are doing a deal with someone that the players previously captured. ---------- Post added at 01:20 AM ---------- Previous post was at 01:18 AM ---------- Yup im a retard, i see that i had creategroup west haha so disregard...... *facepalm* ---------- Post added at 01:22 AM ---------- Previous post was at 01:20 AM ---------- Gah i hate scripting sometimes because it can always be something as small as that. ha
  18. Ha that's what ive been doing. ha. I also have another problem, i'm spawning west units, that are supposed to be friendly with resistance units, yet when they actually meet up, they shoot it out. I have the setfriend syntax applied to both sides as 1. Whats the problem with that?
  19. Thank you!!!!!! Was giving me a headache.
  20. Hey guys, i'm working on a couple of scripts involving making shops. I have several shops implemented and running fine, its just until i start messing with magazines i find myself in trouble. How do i go about selling magazines? Here's what i got; The Checking script: if (Player hasWeapon "ACE_bandage") THEN {sellbandage = player addaction ["sell Bandage - $5","global\medical\sellbandage.sqs",false,-1,false,false,"false"]} Else {player removeaction sellbandage}; The sellbandage.sqs player removeMagazine "ACE_bandage"; money=money+5; exit; I realize the hasweapon is the wrong syntax, but i wanted to detail what i was doing.
  21. Too bad im a newb and can't understand this ha. Which is why i was seeking help on the matter. I don't even know where to start. Guess first would be to know how to spawn a marker randomly on the map, how do you get the random location?
  22. Hello, first i must say that i have been reading these forums for a long time, but for the life of me i can't find what im looking for. Basically, I have an NPC where you can accept missions from. These missions are randomly generated on map, with markers linking to them. I however am new to scripting and still learning, but i can't even get one to spawn randomly. I'm trying to randomly spawn an NPC anywhere on the map, with a marker patched onto it (Like Destroy). I'm supposed to go out and kill the NPC and gain the reward. Any help to a newb scripter would be much appreciated, also, if you feel like im lacking any info, let me know and i'll post what i can.
  23. Okay, i have an NPC that when the player gets close enough, he gets the action to "Accept a Mission." Upon accepting a mission using the action menu, another unit gets randomly spawned somewhere on the map with the name "Target01". "Target01" should also have a destroy marker attached to it as the unit is randomly patrolling the surrounding area that it spawned at. The player then is supposed to go out an destroy "target01" and receive a reward of some cash upon doing so. I already have the cash mechanics working, i just need to know how to spawn units randomly placed on the map with markers attached to them, i can't seem to figure that part out. Thanks again.
  24. I too, would also like help on this.
×