/buylevel command...
#1

Код:
public OnPlayerCommandText(playerid, cmdtext[])
	{
  if (strcmp(cmdtext, "/buylevel", true) == 0)
	{
  gPlayerMoney[playerid] = GetPlayerMoney(playerid);
  if (Level[playerid] == 0)
  {
  Level[playerid] += 1;
  SetPlayerMoney(playerid, gPlayerMoney[playerid] - 500);
  SetPlayerScore(playerid, Level[playerid]);
  SendClientMessage(playerid,COLOR_GREEN,"# Tu nopirki 1. speletaja limeni!");
  }
  else if (Level[playerid] == 1)
  {
  Level[playerid] += 1;
  SetPlayerMoney(playerid, gPlayerMoney[playerid] - 600);
  SetPlayerScore(playerid, Level[playerid]);
  SendClientMessage(playerid,COLOR_GREEN,"# Tu nopirki 2. speletaja limeni!");
  }
  else if (Level[playerid] == 2)
  {
  Level[playerid] += 1;
  SetPlayerMoney(playerid, gPlayerMoney[playerid] - 700);
  SetPlayerScore(playerid, Level[playerid]);
  SendClientMessage(playerid,COLOR_GREEN,"# Tu nopirki 3. speletaja limeni!");
  }
  else if (Level[playerid] == 3)
  {
  Level[playerid] += 1;
  SetPlayerMoney(playerid, gPlayerMoney[playerid] - 800);
  SetPlayerScore(playerid, Level[playerid]);
  SendClientMessage(playerid,COLOR_GREEN,"# Tu nopirki 4. speletaja limeni!");
  }
  else if (Level[playerid] == 4)
  {
  Level[playerid] += 1;
  SetPlayerMoney(playerid, gPlayerMoney[playerid] - 900);
  SetPlayerScore(playerid, Level[playerid]);
  SendClientMessage(playerid,COLOR_GREEN,"# Tu nopirki 5. speletaja limeni!");
  }
  return 1;
  }
It all is, ok, it buys every next level, but if i have bought 1st level and that command works, but if i buy higher level that command whitch i used earlier just dissapears and wont work!
Reply


Messages In This Thread
/buylevel command... - by eyndza - 08.09.2009, 16:25
Re: /buylevel command... - by eyndza - 09.09.2009, 11:48
Re: /buylevel command... - by sekelis2 - 09.09.2009, 18:21
Re: /buylevel command... - by ilikepie2221 - 10.09.2009, 00:04
Re: /buylevel command... - by eyndza - 10.09.2009, 05:00
Re: /buylevel command... - by radi - 10.09.2009, 05:48
Re: /buylevel command... - by eyndza - 10.09.2009, 11:52
Re: /buylevel command... - by radi - 10.09.2009, 12:35
Re: /buylevel command... - by eyndza - 10.09.2009, 13:36
Re: /buylevel command... - by eyndza - 10.09.2009, 17:00

Forum Jump:


Users browsing this thread: 1 Guest(s)