AlliedModders

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

_Rustynails_ 08-29-2004 19:33

amx_score Help
 
I'm making a new plugin called 'amx_score'
Usage: amx_score <user> <kills> <deaths>

I tried compiling this plugin on the AMX Mod X website at www.amxmodx.org/compiler.php?go=sc
I get these errors:

/home/users/amxmodx/tmp/phplM6fME.sma(18) : error 033: array must be indexed (variable "deaths")
/home/users/amxmodx/tmp/phplM6fME.sma(19) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp/phplM6fME.sma(20) : error 035: argument type mismatch (argument 1)
/home/users/amxmodx/tmp/phplM6fME.sma(22) : error 035: argument type mismatch (argument 2)
/home/users/amxmodx/tmp/phplM6fME.sma(23) : error 035: argument type mismatch (argument 2)


Here is my code.
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {   register_plugin("AMX-Score","0.1","Rustynails")   register_clcmd("amx_score","do_score",ADMIN_BAN) } public do_score(id) {   new user[32], kills[4], deaths[4], uid   read_argv(1,user,31)   read_argv(2,kills,3)   read_argv(3,deaths,3)   uid = find_player("bhl",user)   if (access(id,ADMIN_BAN)) {     if (deaths) {       if (isdigit(kills)) {         if (isdigit(deaths)) {           if (uid) {             set_user_frags(uid,kills)             cs_set_user_deaths(uid,deaths)             console_print(id,"Changed score.")             } else {             console_print(id,"No such user has been identified on this server.")           }           } else {           console_print(id,"The amount of deaths may only be in numbers.")         }         } else {         console_print(id,"The amount of kills may only be in numbers.")       }       } else {       console_print(id,"You did not supply enough information.")     }     } else {     console_print(id,"You do not have enough access to use this command.")   }   return PLUGIN_HANDLED }

Thanks for your help.

Nick 08-29-2004 19:41

http://forums.alliedmods.net/showthread.php?t=293+score
look at that ^^ plugin :) maybe it will help you.

_Rustynails_ 08-29-2004 19:44

no
 
nooooooooooo

Nick 08-29-2004 21:39

what?

Greenberet 08-29-2004 22:08

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {   register_plugin("AMX-Score","0.1","Rustynails")   register_clcmd("amx_score","do_score",ADMIN_BAN) } public do_score(id) {   new user[32], killsstring[4], deathstring[4], uid   read_argv(1,user,31)   read_argv(2,killsstring,3)   read_argv(3,deathstring,3)   uid = find_player("bhl",user)   new deaths=str_to_num(deathstring)   new kills=str_to_num(killsstring)   if (access(id,ADMIN_BAN))   {     if (deaths)     {       if (isdigit(kills))       {         if (isdigit(deaths))         {           if (uid)           {             set_user_frags(uid,kills)             cs_set_user_deaths(uid,deaths)             console_print(id,"Changed score.")           }           else           {             console_print(id,"No such user has been identified on this server.")           }         }         else         {           console_print(id,"The amount of deaths may only be in numbers.")         }       }       else       {         console_print(id,"The amount of kills may only be in numbers.")       }     }     else     {       console_print(id,"You did not supply enough information.")     }   }   else   {     console_print(id,"You do not have enough access to use this command.")   }   return PLUGIN_HANDLED }

this one works with 0.20
at compile 0 errors 0 warnings

kalel 10-19-2004 17:43

I don't know if this will help you any but this plugin works for CS and changes score

http://forums.alliedmods.net/showthread.php?t=293+score

and the sma for that is

Code:

/*
*
*  Change Score
*  Version 2.0
*  Author: Freecode;  [email protected] (MSN)  FCunnClan (AIM)
*
*  This plugin will will change persons Frags and Deaths.
*
*  Requirements:
*      Compiled on 0.9.4.
*      Should work successfully on 0.9.3
*      Tested successfully on 0.9.4.
*      Should work successfully on 0.9.5.
*
*  Admin Commands:
*      amx_chscore <nick/@CT/@TERRORIST> <frags #> <deaths #>
*
*  To Do: 
*      Nothing :)
*
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new gmsgScoreInfo
 

public chscore(id,level,cid)
{
        if (!cmd_access(id,level,cid,2))
        {
      return PLUGIN_HANDLED
        }
        new victim[32],deathsI[32],fragsI[32]
        read_argv(1,victim,31)

        read_argv(2,fragsI,31)
        new frags = str_to_num(fragsI)
         
        read_argv(3,deathsI,31)
        new deaths = str_to_num(deathsI)
       
        if (victim[0]=='@')
        {
                new team[32], inum
                get_players(team,inum,"e",victim[1])
                if (inum==0)
                {
                        console_print(id,"[AMX] No clients found on such team.")
                        return PLUGIN_HANDLED
                }
                for (new i=0;i<inum;++i)
                {
                    new teams = get_user_team(team[i]) 
                    set_user_frags(team[i],frags)
                    cs_set_user_deaths(team[i],deaths)
                    message_begin(MSG_ALL,gmsgScoreInfo)
                    write_byte( team[i] ) 
                    write_short(frags)
                    write_short(deaths)
                    write_short(0)
                    write_short(teams)
                    message_end()
                }
        }
        else
        {
                new user = cmd_target(id,victim,0)
                new authid[32]
                get_user_authid(user,authid,31) 
                if (!user)
                {
                        console_print(id,"[AMX] No such client found.")
                        return PLUGIN_HANDLED
                }
                new teams = get_user_team(user)
                set_user_frags(user,frags)
                cs_set_user_deaths(user,deaths)
                message_begin(MSG_ALL,gmsgScoreInfo)
                  write_byte(user)
                  write_short(frags)
                  write_short(deaths)
                  write_short(0)
                  write_short(teams)
                  message_end()
          }
        return PLUGIN_HANDLED
}


public plugin_init()
{
        register_plugin("Change Score","2.0","Freecode")
        register_clcmd("amx_chscore","chscore",ADMIN_CVAR," - amx_chscore <nick/@CT/@TERRORIST> <frags #> <deaths #>")
        gmsgScoreInfo = get_user_msgid("ScoreInfo")
}

I havn't actuly been able to find any where that this plugin works just for CS


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

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