20.09.2012, 09:57
Okay first off, I do not want a Filtersciprt so do not post a thread saying go here. I need help to finish my code off
So my code is completed from scratch for my coin system. At the moment It saves in the player file etc /stats shows the coins you have. But im stuck on my command to give coins. Now i know i have to define it. but this is were im lost.
Ill show you my coin Coding below. Hopefully you can help me out guys.
This part is under enum PInfo {
Then when a player connects It checks the player coins using this
Then its move to when a player Registers
When the Player Logs IN
Then it comes to this part which may be the reason - It loads the coins but wont let me set player coins from in game - This part is Public UpdatePlayerInfo
This is under updateplayerinfo also, about 12 lines below the one above. This is a copy of my money system. I just want a coin system. It works i just need it to load and save coins and be able to give coins in game /givecoins
Coin line before it shows you stats
This is the /stats Coin line
And finally heres the command to give coins.
Please Help Me Out, If you can help me out or Make me a system that is not a Filterscript. I will gladly make a donation to your paypal account
The money system, you can giveplayermoney and takeplayermoney or setplayermoney.
But if i use that for my coin system it just adds to the cash in hand
So my code is completed from scratch for my coin system. At the moment It saves in the player file etc /stats shows the coins you have. But im stuck on my command to give coins. Now i know i have to define it. but this is were im lost.
Ill show you my coin Coding below. Hopefully you can help me out guys.
This part is under enum PInfo {
Code:
pCoins,
Code:
PlayerInfo[playerid][pCoins] = 0;
Code:
format(var, 64, "Coins=%d\n",PlayerInfo[playerid][pCoins]);fwrite(hFile, var);
Code:
if( strcmp( key , "Coins" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCoins] = strval( val ); }
Code:
new var[64]; format(var, 64, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var); PlayerInfo[playerid][pMoney] = Otman_GetPlayerMoney(playerid); PlayerInfo[playerid][pCoins] = GetPlayerCoins(playerid);<< I tried defining getplayercoins but no success format(var, 64, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var); format(var, 64, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
Code:
format(var, 64, "Coins=%d\n",PlayerInfo[playerid][pCoins]);fwrite(hFile, var);
Code:
new coins = PlayerInfo[targetid][pCoins];
Code:
format(coordsstring, sizeof(coordsstring), "Level: %d || Gender: %s || Age: %d || City: %s || Coins: %d", level,atext,age,otext,coins); SendClientMessage(playerid, COLOR_WHITE,coordsstring);
Code:
if(strcmp(cmd, "/givecoins", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 6) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_FAILCMD, "TIP: {FFFFFF}/givecoins [ID or Name/Part of name] [Coins]"); return 1; } new playa; new coins; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); coins = strval(tmp); if (Logged[playa]) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(playa, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "> You Have Given Player %s $%d", giveplayer, coins); SendClientMessage(playerid,COLOR_UPGRADEBLUE, string); format(string, sizeof(string), "> Admin %s Gave You $%d", sendername, coins); SendClientMessage(playa,COLOR_UPGRADEBLUE, string); return 1; } } } } return 1; }
The money system, you can giveplayermoney and takeplayermoney or setplayermoney.
But if i use that for my coin system it just adds to the cash in hand