SA-MP Forums Archive
DDoor weapon rsremoval - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: DDoor weapon rsremoval (/showthread.php?tid=510839)



DDoor weapon rsremoval - kevin1990 - 02.05.2014

How do I remove players weapons when they enter a certain DDoor but give them back to them when the exit the DD?


Re: DDoor weapon rsremoval - Danyal - 02.05.2014

create a global varible on player entering a ddoor and then store their weapon in that variable once he is entered reset his weapon and when he is back give him weapon that you stored in the variable.


Re: DDoor weapon rsremoval - [WSF]ThA_Devil - 02.05.2014

by door did you mean Interior?
if so:
pawn Код:
public OnPlayerUpdate(playerid){
if(GetPlayerInterior(playerid) != 0) {
SetPlayerArmedWeapon(playerid,0);
}
return 1;
}



Re: DDoor weapon rsremoval - kevin1990 - 02.05.2014

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
by door did you mean Interior?
if so:
pawn Код:
public OnPlayerUpdate(playerid){
if(GetPlayerInterior(playerid) != 0) {
SetPlayerArmedWeapon(playerid,0);
}
return 1;
}

Ok if the interior id was 1 and the VW was 24 how would I set that up?


Re: DDoor weapon rsremoval - kevin1990 - 02.05.2014

Quote:
Originally Posted by Danyal
Посмотреть сообщение
create a global varible on player entering a ddoor and then store their weapon in that variable once he is entered reset his weapon and when he is back give him weapon that you stored in the variable.
Could you get me an example danya The door ID would be 1375


Re: DDoor weapon rsremoval - [WSF]ThA_Devil - 02.05.2014

Код:
public OnPlayerUpdate(playerid){
if(GetPlayerInterior(playerid) == 1 && GetPlayerVirtualWorld(playerid)==24) {
SetPlayerArmedWeapon(playerid,0);
}
return 1;
}



Re: DDoor weapon rsremoval - kevin1990 - 02.05.2014

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
Код:
public OnPlayerUpdate(playerid){
if(GetPlayerInterior(playerid) == 1 && GetPlayerVirtualWorld(playerid)==24) {
SetPlayerArmedWeapon(playerid,0);
}
return 1;
}
But when they exit, the guns the had will return to them?


Re: DDoor weapon rsremoval - [WSF]ThA_Devil - 02.05.2014

All that function does, is sets players armed ( weapon in hands ) to fists, so they have weapons all the time, but they can't switch to it.


Re: DDoor weapon rsremoval - kevin1990 - 02.05.2014

Ohh cool, Ill try it out right now. Thanks a lot man.


Re: DDoor weapon rsremoval - kevin1990 - 02.05.2014

Quote:
Originally Posted by [WSF]ThA_Devil
Посмотреть сообщение
All that function does, is sets players armed ( weapon in hands ) to fists, so they have weapons all the time, but they can't switch to it.
Ok so.....

I can compile my script fine with 0 errors or warnings.

When I add that code I get like 26 errors and it doesnt compile at all.

None of the errors are about this code though, it gives me errors about other things but when I take it out it compiles fine again.