AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help? (https://forums.alliedmods.net/showthread.php?t=5422)

_Rustynails_ 08-31-2004 20:29

Help?
 
I don't remember the error I get. But I get something. Please check it out?
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {   register_plugin("AMX-ROB","0.1","Rustynails")   register_clcmd("amx_rob","steal_money",ADMIN_KICK) } public steal_money(id) {   new user[32], yname[32], uname[32], umoney, smoney, nmoney, gmoney, lmoney, uid   read_argv(1,user,31)   get_user_name(id,yname,31)   get_user_name(id,uname,31)   uid = find_player("bl",user)   umoney = cs_get_user_money(id)   smoney = cs_get_user_money(uid)   if (access(id,ADMIN_KICK)) {     if (uid) {       if (!access(id,ADMIN_IMMUNITY)) {         if (umoney != 16000) {           nmoney = 16000 - umoney           if (smoney >= nmoney) {             gmoney = nmoney + umoney             lmoney = smoney - nmoney             cs_set_user_money(id,gmoney,1)             cs_set_user_money(uid,lmoney,1)             console_print(id,"Success")             client_print(id,print_chat,"You just stole %d dollar(s) from %s. They now have %d dollar(s) left.",nmoney,uname,lmoney)             client_print(uid,print_chat,"%s just stole %d dollar(s) from you. You now have %d dollar(s).",yname,nmoney,lmoney)             } else if (smoney == 0) {             console_print(id,"%s does not have any money.",uname)             client_print(id,print_chat,"You could not steam anything from %s because he/she currently has %d dollar(s).",uname,smoney)                     } else {             gmoney = umoney + smoney             lmoney = smoney - smoney             cs_set_user_money(id,gmoney,1)             cs_set_user_money(uid,lmoney,1)             console_print(id,"Success")             client_print(id,print_chat,"%s only had %d dollar(s), so you stole it all.",uname,smoney)             client_print(uid,print_chat,"%s has stolen all of your money!",yname)           }           } else {           console_print(id,"You already have the most money you can have.")                   }         } else {         console_print(id,"This person is immune to this command.")         client_print(id,print_chat,"Laf. You can't steal %s's money, %s!",uname,yname)       }       } else {       console_print(id,"Could not find that user.")     }     } else {     console_print(id,"You lack access to use this command.")   }   return PLUGIN_HANDLED }

KRoT@L 08-31-2004 22:10

Compiled with no errors, but you should change that :

Code:
    get_user_name(id,yname,31)   get_user_name(id,uname,31)   uid = find_player("bl",user)   umoney = cs_get_user_money(id)   smoney = cs_get_user_money(uid)

into

Code:
    get_user_name(id,yname,31)   uid = find_player("bl",user)   get_user_name(uid,uname,31)   umoney = cs_get_user_money(id)   smoney = cs_get_user_money(uid)


All times are GMT -4. The time now is 17:24.

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