public OnPluginEnd() { for (new i = 1; i <= MaxClients; i++) { if (IsClientInGame(i)) { SaveData(i); } }
CloseHandle(g_KV); }
public Action:Timer_GetCredits(Handle:timer) { new value; if ((value = GetConVarInt(g_CvarGetCreditPerMin))) { for (new i = 1; i <= MaxClients; i++) { if (IsClientInGame(i)) { points[i] += value; PrintToChat(i, "You get %d points.", value); } } } }
public OnClientPutInServer(client) { LoadData(client); }
public OnClientDisconnect(client) { SaveData(client); }
Something like this should be using SQL, not KeyValues. While KeyValues technically work, SQL is much much faster.
I will also like to use SQL.
Has a website so it is not reached problem for me that use SQL
Spoiler
PHP Code:
CREATE TABLE `sm_store_credits` ( `steam_id` varchar(25) CHARACTER SET utf8 NOT NULL, `credits` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I will also like to use SQL.
Has a website so it is not reached problem for me that use SQL
Spoiler
PHP Code:
CREATE TABLE `sm_store_credits` (
`steam_id` varchar(25) CHARACTER SET utf8 NOT NULL,
`credits` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
You posted in the scripting section, not the requesting section. All you're going to get is scripting help.
Yes... mcpan's example isn't an ideal example. There are some bad habits in there.
He did link you to scripting help that bail(?) was generous to write on the wiki, which should be able to get
you started on scripting it. You won't find anyone writing you a store plugin for free, so if you don't like the notd
store, offer to pay in the plugin requests (or write your own)