Jump to content

Problema /givemoney


RABIGKY

Recommended Posts

CMD:givemoney(playerid, params[])
{
	new string[256], id, amount;
	if(sscanf(params, "ud", id, amount)) return SCM(playerid, -1, "SYNTAX:/givemoney <playerid> <amount>");
	else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "INVALID ID");
	else
	{
		format(string, sizeof(string), "%s ti-a dat %d bani.", GetName(playerid), amount);
		SCM(playerid, COLOR_BLUE, string);
		GivePlayerMoney(id, amount);
		gQuery[0] = EOS;
		mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Money`='%d' WHERE `ID`='%d'", GetPlayerMoney(playerid), PlayerInfo[playerid][pSQLID]);
		mysql_tquery(SQL, gQuery, "", "");
		
	}
	return 1;
}

Salut, am incercat sa fac o comanda... Am facut ca atunci cand imi dau bani sa se salveze in baza de date, dar daca reintru pe server, am 0 bani, cu toate ca in baza imi apare ca am o suma de bani... Ma puteti ajuta?

NU E DE COMPETENTA MEA SA FAC LUMEA MAI BUNA.

 

Link to comment
Share on other sites

~Inearca asta!~

 

CMD:givemoney(playerid, params[]) {
    new string[128], id, amount;
    if(sscanf(params, "ud", id, amount)) return SCM(playerid, -1, "SYNTAX:/givemoney <playerid> <amount>");
    if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "INVALID ID");

    format(string, sizeof(string), "%s ti-a dat %d bani.", GetName(playerid), amount);
    SCM(playerid, COLOR_BLUE, string);

    GivePlayerMoney(id, amount);

    gQuery[0] = EOS;
    mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Money`='%d' WHERE `ID`='%d'", GetPlayerMoney(id), PlayerInfo[id][pSQLID]);
    mysql_tquery(SQL, gQuery, "", "");
        
    
    return 1;
}

Link to comment
Share on other sites

59 minutes ago, [El.Capo] said:

~Inearca asta!~

 

CMD:givemoney(playerid, params[]) {
    new string[128], id, amount;
    if(sscanf(params, "ud", id, amount)) return SCM(playerid, -1, "SYNTAX:/givemoney <playerid> <amount>");
    if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "INVALID ID");

    format(string, sizeof(string), "%s ti-a dat %d bani.", GetName(playerid), amount);
    SCM(playerid, COLOR_BLUE, string);

    GivePlayerMoney(id, amount);

    gQuery[0] = EOS;
    mysql_format(SQL, gQuery, sizeof(gQuery), "UPDATE `users` SET `Money`='%d' WHERE `ID`='%d'", GetPlayerMoney(id), PlayerInfo[id][pSQLID]);
    mysql_tquery(SQL, gQuery, "", "");
        
    
    return 1;
}

Nu merge.. Se salveaza in baza de date, dar daca ies si intru din nou am 0 bani ... Am sa mai ma uit prin GM, poate e de la logare..

EDIT: Nu am reusit, ma poate ajuta cineva?

Edited by RABIGKY
edit

NU E DE COMPETENTA MEA SA FAC LUMEA MAI BUNA.

 

Link to comment
Share on other sites

1 oră în urmă, RABIGKY a spus:

Nu merge.. Se salveaza in baza de date, dar daca ies si intru din nou am 0 bani ... Am sa mai ma uit prin GM, poate e de la logare..

EDIT: Nu am reusit, ma poate ajuta cineva?

Daca vrei imi dai date supremo si te ajut in legatura cu problema ta !

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.