Raised This Month: $ Target: $400
 0% 

Rock the vote plugin (no money update)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sleeperzzz
Senior Member
Join Date: Aug 2004
Location: In my bed
Old 08-22-2007 , 19:22   Rock the vote plugin (no money update)
Reply With Quote #1

Hello my dear scripters,

I would ask some help regarding an addtion i wan't for a plugin.

I got no basic knowledge of amxx coding yet i manage once and a while yet not this time.

To topic:
I wish to make the money be set to 0 when the player drops there gun.This comes from a rock the vote plugin (deagsmapmanage230b.sma) and i wanted to add this.

I took a look in a plugin amx_bankrupt since that uses cs_set_user_money()

I tried to use that in the deagsmapmanagment but ended up with errors and loose idents so yeah i wanna get teached.

What do i need to perfectly implement the cs_set_user_money() ??

Anyone that helps me out gets the usual karma .

Thank you

Here's the code wich makes the player stop and drop there guns. i would put the command infront of the drop command so they can't buy after the drop.



Code:
public stopperson(){ 
   new players[32], inum, i 
   get_players(players,inum,"c") 
   if(isspeedset>=0&&isspeedset<2){   
      thespeed=get_cvar_float("sv_maxspeed") 
      isspeedset++
      set_cvar_float("sv_maxspeed", 0.0)
   }
   for(i = 0 ;i < inum; ++i) 
      client_cmd(players[i],"drop")
   return PLUGIN_HANDLED 
}
__________________
sleeperzzz is offline
Send a message via AIM to sleeperzzz Send a message via MSN to sleeperzzz Send a message via Yahoo to sleeperzzz Send a message via Skype™ to sleeperzzz
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 08-23-2007 , 07:56   Re: Rock the vote plugin (no money update)
Reply With Quote #2

Your problem is probably that the client_cmd(,"drop") is not within braces, just the next line.

So you need to change these lines:
Code:
   for(i = 0 ;i < inum; ++i)       client_cmd(players[i],"drop")
To this:
Code:
   for(i = 0 ;i < inum; ++i)    {     client_cmd(players[i],"drop")     cs_set_user_money(players[i],0)    }

Which should force them to drop their weapon and reset money to 0
purple_pixie is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:15.


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