Guest User

Untitled

a guest
Jan 7th, 2015
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. if(strcmp(cmdtext, "/charity", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid))
  4. {
  5. if(gLogged[playerid] == 1)
  6. {
  7. temp = strtok(cmdtext, idx);
  8. if(!strlen(temp))
  9. {
  10. SendClientMessage(playerid, COLOR_SYNTHAX, "Synthax: /charity <Amount of Money>");
  11. return 1;
  12. }
  13. new money;
  14. money = strval(temp);
  15. if(money < 0)
  16. {
  17. SendClientMessage(playerid, COLOR_ERROR, "You can't sent less than 1$.");
  18. return 1;
  19. }
  20. money = strval(temp);
  21. if(GetPlayerMoney(playerid) < money)
  22. {
  23. SendClientMessage(playerid, COLOR_ERROR, "You don't have that amount of money.");
  24. return 1;
  25. }
  26. GivePlayerMoney(playerid, -money);
  27. Update(playerid, pCashu);
  28. format(string, sizeof(string), "You sent %d for players level 2-7.", FormatNumber(money));
  29. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  30. CharityMoney += money;
  31. //
  32. new query[128];
  33. format(query,128,"UPDATE `charity` SET `CharityMoney`='%d' WHERE `ID`='1'",CharityMoney);
  34. mysql_query(sqldb,query);
  35. }
  36. else
  37. {
  38. //
  39. }
  40. }
  41. return 1;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment