wep shoot disable

Started by MEGAMIND, Jul 04, 2018, 12:51 PM

Previous topic - Next topic

MEGAMIND

how can we disable weps in a world

ive tried this so far

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

I am gamer, programmer and hacker. Try to find me!
xD

MEGAMIND

Quote from: umar4911 on Jul 04, 2018, 06:10 PMWorked for me
how the actuall f* did it worked for u when u move a muscle the thing gets disabled again :/

MEGAMIND

*bump* pls

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

NicusorN5

player.CanAttack = false; Is under a comment. You are actually not using player.CanAttack property in that snippet.

MEGAMIND

Quote from: Athanatos on Jul 05, 2018, 06:16 AM 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

Kelvin Garcia Mendoza

//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:

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:
player.IsWeaponSyncBlocked = false;

MEGAMIND

Quote from: =TRC=Kelvin on Jul 05, 2018, 07:59 AM//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:

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:
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....

MEGAMIND

Problem solved locking topic for further info who doesnt knows how to do it shoot me a pm i'll help him :)

DizzasTeR

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

#10
Quote from: Doom_Kill3R on Jul 05, 2018, 11:18 AMOr 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
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

DizzasTeR

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

Quote from: Doom_Kill3R on Jul 05, 2018, 11:37 AMI 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

!

You must be doing something wrong. I've done it many times worked for me.

try changing player world before disabling attack.
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 );
}

Discord: zeus#5155

MEGAMIND

Quote from: ! on Jul 05, 2018, 02:04 PMYou must be doing something wrong. I've done it many times worked for me.

try changing player world before disabling attack.
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 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;
 }
}