SA-MP Forums Archive
/buylevel command... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /buylevel command... (/showthread.php?tid=96491)



/buylevel command... - eyndza - 08.09.2009

Код:
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!


Re: /buylevel command... - eyndza - 09.09.2009

Anyone?


Re: /buylevel command... - sekelis2 - 09.09.2009

Help him maybe?



Re: /buylevel command... - ilikepie2221 - 10.09.2009

Change all the

pawn Код:
else if (Level[playerid] <= 2 // and 3,4,5,whatever)
to just =.

For example:

[pawn]
else if(Level[playerid] <= 2) // BAAAD
else if(Level[playerid] = 2) // GOOD


Re: /buylevel command... - eyndza - 10.09.2009

Thanx for the helping of course, but it wont help! ; (


Re: /buylevel command... - radi - 10.09.2009

oke this is a bit of a mess
because you dont have anything to level up with
because you do if level 1
but how do they get lvl 1 ?
i think its based on the score ?
so if you have a rp script
i think you have exp ?
maby you can do that toghere
lvl 1 and 2 exp is level 2
lvl 2 and 3 exp is lvl 3
like that


Re: /buylevel command... - eyndza - 10.09.2009

WTF? i don't have any stupid RP with stupid exp, i just need /buylevel. to buy easy commands, example if player level1 he can use /flip, if player is level 2 he can use /antifall, that is what i am looking for!


Re: /buylevel command... - radi - 10.09.2009

yea
but how can he get lvl 1
because you dont have something to make him lvl 1
because if you enter you score will be on 0 so


Re: /buylevel command... - eyndza - 10.09.2009

I don't need smart talking, i need examples or you to fix that code, thanx!

IF YOU CANT FIX THE PROBLEM THEN DON'T COMMENT!


Re: /buylevel command... - eyndza - 10.09.2009

Please, anyone, sorry for doubleposting again, but i just need this command to be fixed much faster, thanx again!