- 0
Problema la comanda /GiveCash
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
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.
Question
Samy Romafia
Am luat comandaasta din sexiunea ''Tutoriale Folositoare'' si am puso in GM.
Imi da eroarele astea:
/*----------------------------------------------------------------------------------------------------------------*/ public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmd, "/givecash", true) == 0) { /////////3611 tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecash [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecash [playerid] [amount]"); return 1; } moneys = strval(tmp); if (IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); playermoney = GetPlayerMoney(playerid); if (moneys > 0 && playermoney >= moneys) { GivePlayerMoney(playerid, (0 - moneys)); GivePlayerMoney(giveplayerid, moneys); format(string, sizeof(string), "You gave %s(player: %d), $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, COLOR_GREY, string); format(string, sizeof(string), "You recieved $%d from %s(player: %d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_GREY, string); printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid); }else { SendClientMessage(playerid, COLOR_GREY, "Invalid transaction amount."); } }else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_GREY, string); } return 1; }www.dsrclan.forumfree.it
7 answers to this question
Recommended Posts