Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment