04.06.2009, 17:26
Look, it takes a couple simple variables and a command. Here..
Not tested, but should work.
Код:
new gPlayerLevel[MAX_PLAYERS]; // above main() new gPlayerMoney[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmd, "/buylevel", true) == 0) { gPlayerMoney[playerid] = GetPlayerMoney(playerid); if (GetPlayerMoney(playerid) >= 250000) { gPlayerLevel[playerid] += 1; SetPlayerMoney(playerid, gPlayerMoney[playerid] - 250000); } return 1; } if (strcmp(cmd, "/flip", true) == 0) { if (gPlayerLevel[playerid] > 1) { SendClientMessage(playerid, 0xFFFFFFFF, "I just... flipped?"); return 1; } else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not high enough level to use this!"); } }