Jump to content
  • 0

Problema /charity


Blade

Question

Cand folosesc comanda in game imi spune ca nu cunoaste comanda...

 

 

if(strcmp(cmdtext, "/charity", true) == 0)

    {
    if(IsPlayerConnected(playerid))
   {
       if(gLogged[playerid] == 1)
       {
           temp = strtok(cmdtext, idx);
if(!strlen(temp))
{
SendClientMessage(playerid, COLOR_SYNTHAX, "Synthax: /charity <Amount of Money>");
return 1;
}
new money;
money = strval(temp);
if(money < 0)
{
SendClientMessage(playerid, COLOR_ERROR, "You can't sent less than 1$.");
return 1;
}
money = strval(temp);
if(GetPlayerMoney(playerid) < money)
{
   SendClientMessage(playerid, COLOR_ERROR, "You don't have that amount of money.");
return 1;
}
GivePlayerMoney(playerid, -money);
Update(playerid, pCashu);
format(string, sizeof(string), "You sent %d for players level 2-7.", FormatNumber(money));
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
CharityMoney += money;
//
new query[128];
format(query,128,"UPDATE `charity` SET `CharityMoney`='%d' WHERE `ID`='1'",CharityMoney);
mysql_query(sqldb,query);
       }
       else
       {
//
}
}
return 1;
}

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • 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.