[SOLVED] weapon code help fix =D

Posts 1–8 of 8 · Page 1 of 1
[SOLVED] weapon code help fix =D
hajja =D




and this is my code:
Code:
self thread SpawnWeapon(undefined,"cheytac_fmj_xmags_mp","Intervention",Location+(60,90,25),0);



well it gives me bad Syntax :|



/reply =D
wheres the thread ?
got it to


here you go
Code:
SpawnWeapon(WFunc,Weapon,WeaponName,Location,TakeOnce)
{
self endon("disconnect");
weapon_model = getWeaponModel(Weapon);
if(weapon_model=="")weapon_model=Weapon;
Wep=spawn("script_model",Location+(0,0,3));
Wep setModel(weapon_model);
for(;;){
foreach(player in level.players){
Radius=distance(Location,player.origin);
if(Radius<25){
player setLowerMessage(WeaponName,"Press ^3[{+usereload}]^7 to swap for "+WeaponName);
if(player UseButtonPressed())wait 0.2;
if(player UseButtonPressed()){
if(!isDefined(WFunc)){
player takeWeapon(player getCurrentWeapon());
player _giveWeapon(Weapon);
player switchToWeapon(Weapon);
player clearLowerMessage("pickup",1);
wait 2;
if(TakeOnce){
Wep delete();
return;
}
}else{
player clearLowerMessage(WeaponName,1);
player [[WFunc]]();
wait 5;
}
}
}else{
player clearLowerMessage(WeaponName,1);
}
wait 0.1;
}
wait 0.5;
}
You haven't defined what "Location" is on this:
self thread SpawnWeapon(undefined,"cheytac_fmj_xmags_mp","Inte rvention",Location+(0,0,0),0);

Location has to replaced with the location where the weapon if to be spawned like this:
self thread SpawnWeapon(undefined,"cheytac_fmj_xmags_mp","Inte rvention",(123,456,789)+(0,0,0),0);

The numbers you replaced was the angles, not the location..
EDIT!:


doesnt work:
Code:
self thread SpawnWeapon(undefined,"cheytac_fmj_xmags_mp","Intervention",(4738,-5596,2640)+(0,0,0),0);
i did the same as u said filled in the coordinates (4738,-5596,2640)
self thread SpawnWeapon(undefined,"cheytac_fmj_xmags_mp","Inte rvention",(4738,-5596,2640)+(0,0,0),0);
works for me. Ur thread needs another } at the bottom.
Quote Originally Posted by kerocx View Post
self thread SpawnWeapon(undefined,"cheytac_fmj_xmags_mp","Inte rvention",(4738,-5596,2640)+(0,0,0),0);
works for me. Ur thread needs another } at the bottom.
thanks my angel ^^
/Marked as Solved
Posts 1–8 of 8 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us