Actually the AI is not wrong it's just missing alot of informations, not sure how the AI access each language resources, although it's not bad , here I asked the AI to create user frags displayment after a long dialogue.
The results:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <nvault>
new g_playerFrags[33]
public plugin_init()
{
register_plugin("Frag Display", "1.0", "YourName")
}
public client_putinserver(id)
{
new szName[32], szFrags[32]
get_user_name(id, szName, 31)
if (nvault_get(szName, "frags", szFrags, 31))
{
g_playerFrags[id] = str_to_num(szFrags)
}
else
{
g_playerFrags[id] = 0
}
client_print(id, print_chat, "Welcome to the server! Your current frag count is %d.", g_playerFrags[id])
}
public client_disconnected(id)
{
new szName[32], szFrags[32]
get_user_name(id, szName, 31)
g_playerFrags[id] += get_user_frags(id)
num_to_str(g_playerFrags[id], szFrags, 31)
nvault_set(szName, "frags", szFrags)
}
NGL truly an amazing achievement.
Questions + Fixes I asked the AI to update.
Code:
* Create an amxmodx plugin that display user fragment.
* Use nVault module to save user fragment on disconnect
* Update include name Nvidia to nvault
* Update nvault_set as it takes the third argument ad a string.
* Load user frags from nvault in client_putinserver
* Instead of displaying a welcoming message in client_putinserver save user frags in a global player variable.
* No need to print a message for the client in client_disconnect or client_disconnected forward because it would be already late because the client had already left the server.
* Remove client_disconnect because it is deprecated.
* Set user frags to the global variable g_PlayerFrags in putinserver function.
* Update local variables names with the tag "sz" that are strings
* Amxmodx doesn't support memory manipulation, fix szFrags = g_playerFrags.
* Add user frags to g_playerfrags when converting to a string in client_disconnected
__________________