Raised This Month: $ Target: $400
 0% 

Problems with getting data/setting data


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 12-23-2005 , 01:37  
Reply With Quote #3

I dont get how this will help. It crashed my server...

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init()     {     register_plugin("Easy Plugin Tester", ".9b", "slmclarengt(sleeper)")     register_concmd("amx_testplugin", "testPlugin", ADMIN_BAN, "Saves money, team & map to be reverted") } public testPlugin()     {     /*     new temp[128]     read_argv(1,temp,5)     new id=str_to_num(temp) // let's make 'id'     */         new map[64]     get_mapname(map, 64)         new directory[60]     get_configsdir(directory, 60)         new authid[32], money[32], teams[2], names[33][32], frags[128], deaths[128]         console_print(0, "DEBUG 'tester - testPlugin': Phase 1: Variables - Passed")         for (new a = 1; a <= get_maxplayers(); a++)         {         get_user_team(a, teams[a], 2)                 get_user_authid(a, authid[a], 34) // get authid         money[a] = cs_get_user_money(a) // save the money of index 'a' player         get_user_name(a, names[a], 32) // initialize names[a] to user's name         frags[a] = get_user_frags(a) // get frags         deaths[a] = get_user_deaths(a)// get deaths                 // format to %configdir%/info.txt - starts with: name, authid, money, team         format("%s/info.txt", 75, "%s %s %d %s %d %d", directory, names[a], authid[a], money[a], teams[a], frags[a], deaths[a])     }         console_print(0, "DEBUG 'tester - testPlugin': Phase 2: After for loop - Passed")         client_print(0, print_chat, "Money/team/map have been saved - changing map and reverting back")     client_print(0, print_chat, "Map is changing back to %s in 15 seconds!", map)         set_task(15.0,"server_cmd('changelevel %s', map)",0) // change map in 15 seconds     set_task(45.0, "revertBack", 0) // call "revertBack" after 45 seconds!         return PLUGIN_CONTINUE } public revertBack(id)     {           new map[64]     get_mapname(map, 64)         new directory[60]     get_configsdir(directory, 60)         new authid[32], money[32], teams[2], names[33][32], frags[128], deaths[128]         console_print(0, "DEBUG 'tester - revertBack': Phase 1: Variables - Passed")         for( new i = 1; i <= get_maxplayers(); i++ )         {         get_user_team(i, teams[i], 2)         get_user_authid(i, authid[i], 34) // get authid         money[i] = cs_get_user_money(i) // save the money of index i player         frags[i] = get_user_frags(i)         deaths[i] = get_user_deaths(i)                 read_file("%s/info.txt", i, names[i], 32, names[i+1][i]) // read/save         read_file("%s/info.txt", i, authid[i], 32, authid[i]) // read/save         read_file("%s/info.txt", i, money[i], 32, money[i]) // read/save         read_file("%s/info.txt", i, teams[i], 2, teams[i]) // read/save         read_file("%s/info.txt", i, frags[i], 128, frags[i]) // read/save         read_file("%s/info.txt", i, deaths[i], 128, deaths[i]) // read/save                 if (is_user_connecting(i) == 1)             {             if (is_user_connected(i) == 1)                 {                 cs_set_user_team(i, teams[i])                 cs_set_user_deaths(i, deaths[i])                 set_user_frags(i, frags[i])                 cs_set_user_money(i, money[i], 1)                                 set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)                 show_hudmessage(id, "Your Money/Team/Frags/Death have been restored!")                      }         }             }     console_print(0, "DEBUG 'tester - testPlugin': Phase 2: After for loop - Passed")         return PLUGIN_HANDLED }
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
 



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 16:10.


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