AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   drop Ent befor weapon using cmd drop ? (https://forums.alliedmods.net/showthread.php?t=281497)

abdobiskra 04-13-2016 00:51

drop Ent befor weapon using cmd drop ?
 
Hi!
i make function when player have Ent (sword) can drop it

this function ==> register_clcmd("drop", "player_dropEnt")
this cmd ==>
register_clcmd("drop", "player_dropEnt")

here client when used this cmd "drop" ===> Ent + Weapon Droped !

but i want only Ent in first drop and weapons in next drop

how i can block drop weapon in first drop ?

siriusmd99 04-13-2016 07:46

Re: drop Ent befor weapon using cmd drop ?
 
PHP Code:

public drop_ent(id){

  if(
g_has_ent[id]){
  
//if user has entity then you drop it with your code or function
//add here your code that drops entity


  
return PLUGIN_HANDLED;
  
//After your dropped entity , you block weapon drop by returning handled
 
}

return 
PLUGIN_CONTINUE;
//If player doesn't have entity, weapon drop won't be blocked


You shall have a global boolean array which checks if player has the entity :
new g_has_entity[33]

I think you understand.

abdobiskra 04-13-2016 09:52

Re: drop Ent befor weapon using cmd drop ?
 
siriusmd99
yes i understand.
Thank you so much dude :D


All times are GMT -4. The time now is 18:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.