wep shoot disable

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
wep shoot disable
«  »
how can we disable weps in a world

ive tried this so far

Code: [Select]
else if ( cmd == "drift" )
{
 MessagePlayer( "*** Teleported To Drifting Arena..If You Want To Exit Type /leave ", player );
               
  player.IsWeaponSyncBlocked = false;
//also tried this           player.CanAttack = false;
  player.World = 9;
}

but none of them works i can still fire or attach in that world

umar4911

  • Sr. Member
  • Creating own server!
  • Posts: 353
I am gamer, programmer and hacker. Try to find me!
xD

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
Re: wep shoot disable
« Reply #2,  »
Quote from umar4911 on July 4th, 07:10 PM
Worked for me
how the actuall f* did it worked for u when u move a muscle the thing gets disabled again :/
Re: wep shoot disable
« Reply #3,  »
*bump* pls

How can i stop everyoneone from stop attacking or shooting/killing in a specific world

Athanatos

  • Hero Member
  • Working on maybe the best VC:MP server ever
  • Posts: 584
Re: wep shoot disable
« Reply #4,  »
Code: [Select]
player.CanAttack = false;
Is under a comment. You are actually not using player.CanAttack property in that snippet.

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
Re: wep shoot disable
« Reply #5,  »
Quote from Athanatos on July 5th, 07:16 AM
Code: [Select]
player.CanAttack = false;
Is under a comment. You are actually not using player.CanAttack property in that snippet.
i got it what ur trying to say but that still doesnt work ,if i still move a muscle or walk then player starts shooting again i want to disable the shooting system or player attacking system in a specific world

=TRC=Kelvin

  • Jr. Member
  • Posts: 60
Re: wep shoot disable
« Reply #6,  »
Code: [Select]
//also tried this           player.CanAttack = false;

If the “//also tried this” is in a line of your command (in your script), just remove it.
It should look like this:

Code: [Select]
if ( cmd == "drift" )
{
 MessagePlayer( "*** Teleported To Drifting Arena..If You Want To Exit Type /leave ", player );             
 player.IsWeaponSyncBlocked = false;
 player.CanAttack = false;
 player.World = 9;
}

If this doesn’t work, try removing this line from the command:
Code: [Select]
player.IsWeaponSyncBlocked = false;

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
Re: wep shoot disable
« Reply #7,  »
Quote from =TRC=Kelvin on July 5th, 08:59 AM
Code: [Select]
//also tried this           player.CanAttack = false;

If the “//also tried this” is in a line of your command (in your script), just remove it.
It should look like this:

Code: [Select]
if ( cmd == "drift" )
{
 MessagePlayer( "*** Teleported To Drifting Arena..If You Want To Exit Type /leave ", player );             
 player.IsWeaponSyncBlocked = false;
 player.CanAttack = false;
 player.World = 9;
}

If this doesn’t work, try removing this line from the command:
Code: [Select]
player.IsWeaponSyncBlocked = false;
dude no of this work // -> this part was already commented and i knew that, + i made it working by my self which clicked my mind when i visited VK's server....
Re: wep shoot disable
« Reply #8,  »
Problem solved locking topic for further info who doesnt knows how to do it shoot me a pm i'll help him :)

Doom_Kill3R

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,056
Re: wep shoot disable
« Reply #9,  »
Or perhaps post the answer in your reply so if anyone has this issue in future he can simply find the answer here instead of PM'ing you

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
Re: wep shoot disable
« Reply #10,  »Last edited
Quote from Doom_Kill3R on July 5th, 12:18 PM
Or perhaps post the answer in your reply so if anyone has this issue in future he can simply find the answer here instead of PM'ing you
:) welp didnt thought of that, posting it


idk maybe this would look noobish to every pro scripter out there, but this did the job for me..if anyone else has a better way to do it, mind sharing it.... :) ok so here it is
Code: [Select]
function onPlayerJoin( player )
{
NewTimer("onPlayerCanAttack",100,0, player.Name, player.ID )
}

function onPlayerCanAttack(playername,playerid)
{
 local player = FindPlayer(playerid);
 if (player == null || player.Name != playername) return 0;
 if (player.World == 9) {
 player.CanAttack = false;
 }
}
Topic unlocked for better suggestions

Doom_Kill3R

  • VC:MP Beta Tester
  • Infinite loops defy infinity by overflowing memory
  • Posts: 1,056
Re: wep shoot disable
« Reply #11,  »
I really think you're doing something wrong, I have used player.CanAttack alot before in the official squirrel plugin and never had any issues with it with worlds or anything.

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
Re: wep shoot disable
« Reply #12,  »
Quote from Doom_Kill3R on July 5th, 12:37 PM
I really think you're doing something wrong, I have used player.CanAttack alot before in the official squirrel plugin and never had any issues with it with worlds or anything.
the thing which i did above is fixed code which i have done before then that was awfull and wont work

!

  • Sr. Member
  • Don't feel shy while zooming on h*r...
  • Posts: 360
Re: wep shoot disable
« Reply #13,  »
You must be doing something wrong. I've done it many times worked for me.

try changing player world before disabling attack.
Code: [Select]
if ( cmd == "drift" )
{
 player.World = 9;         
 player.IsWeaponSyncBlocked = false;
 player.CanAttack = false;
 MessagePlayer( "*** Teleported To Drifting Arena..If You Want To Exit Type /leave ", player );
}

MEGAMIND

  • Hero Member
  • Developer of "Web-Net" search engine
  • Posts: 569
Re: wep shoot disable
« Reply #14,  »
Quote from ! on July 5th, 03:04 PM
You must be doing something wrong. I've done it many times worked for me.

try changing player world before disabling attack.
Code: [Select]
if ( cmd == "drift" )
{
 player.World = 9;         
 player.IsWeaponSyncBlocked = false;
 player.CanAttack = false;
 MessagePlayer( "*** Teleported To Drifting Arena..If You Want To Exit Type /leave ", player );
}
hhhhhhhhhhh topic already solved
Code: [Select]
function onPlayerJoin( player )
{
NewTimer("onPlayerCanAttack",100,0, player.Name, player.ID )
}

function onPlayerCanAttack(playername,playerid)
{
 local player = FindPlayer(playerid);
 if (player == null || player.Name != playername) return 0;
 if (player.World == 9) {
 player.CanAttack = false;
 }
}