31.05.2011, 19:48
Testa ai.
pawn Код:
enum pInfo
{
pGold
};
new PlayerInfo[MAX_PLAYERS][pInfo];
new string[128];
if(strcmp(cmd, "/transformargold", true) == 0)
{
if(GetPlayerMoney(playerid) < 1000000) return SendClientMessage(playerid, -1, "ERROR: Vocк nгo tem 1kk");
GivePlayerMoney(playerid, -1000000);
PlayerInfo[playerid][pGold]++;
format(string,sizeof(string),"1kk transformado para 1 Gold. Vocк agora possui %i Gold e %i$ em mгos.", PlayerInfo[playerid][pGold], GetPlayerMoney(playerid));
SendClientMessage(playerid,-1,string);
return 0x01;
}
if(strcmp(cmd, "/destranformargold", true) == 0)
{
new gold;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "/destranformargold [golds]");
gold = strval(tmp);
if(PlayerInfo[playerid][pGold] < gold || gold < 1 || gold > 10) return SendClientMessage(playerid, -1, "ERROR: Vocк nгo tem essa quantia | Min 1 - mбx 10");
PlayerInfo[playerid][pGold]-=gold;
GivePlayerMoney(playerid, 1000000*gold);
format(string,sizeof(string),"Vocк tem %i gold's disponнveis e possui agora %i em mгos.", PlayerInfo[playerid][pGold], GetPlayerMoney(playerid));
SendClientMessage(playerid,-1,string);
return 0x01;
}