SA-MP Forums Archive
Help Me With Coin System - 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)
+--- Thread: Help Me With Coin System (/showthread.php?tid=443672)



Help Me With Coin System - xFirex - 13.06.2013

hi i see some server created coins system, i want it too

example:

pls help me


Re: Help Me With Coin System - xFirex - 13.06.2013

up...


Re: Help Me With Coin System - park4bmx - 13.06.2013

this a help section you need to provide some code !

at least make the textdraw!

then save them into a player variable
pawn Code:
new pPlayerXp[MAX_PLAYERS];

stock GivePlayerXP(playerid,XP)
{
      pPlayerXp[playerid] += XP;
      return 1;
}
stock RemovePlayerXP(playerid,XP)
{
      pPlayerXp[playerid] -= XP;
      return 1;
}
stock ResetPlayerXP(playerid,XP)
{
      pPlayerXp[playerid] =0;
      return 1;
}
stock UpdatePlayerXP(playerid,XP)
{
      new Str[20];format(Str, sizeof Str, "XP: %d", pPlayerXp[playerid]);
      TextDrawSetString(YourTextdrawID, Str);  
      return 1;
}
that will get you started


Re: Help Me With Coin System - Pottus - 13.06.2013

Quote:
Originally Posted by park4bmx
View Post
this a help section you need to provide some code !

at least make the textdraw!

then save them into a player variable
pawn Code:
new pPlayerXp[MAX_PLAYERS];

stock GivePlayerXP(playerid,XP)
{
      pPlayerXp[playerid] += XP;
      return 1;
}
stock RemovePlayerXP(playerid,XP)
{
      pPlayerXp[playerid] -= XP;
      return 1;
}
stock ResetPlayerXP(playerid,XP)
{
      pPlayerXp[playerid] =0;
      return 1;
}
stock UpdatePlayerXP(playerid,XP)
{
      new Str[20]; format(Str, sizeof Str, "XP: %d", pPlayerXp[playerid]);
      TextDrawSetString(YourTextdrawID, Str);  
      return 1;
}
that will get you started
Why use stock functions ?
Why bother using "return 1;" on UpdatePlayerXP?

pawn Code:
new pPlayerXp[MAX_PLAYERS];

#define GivePlayerXP(%0,%1) pPlayerXp[%0] += %1
#define RemovePlayerXP(%0,%1) pPlayerXp[%0] -= %1
#define ResetPlayerXP(%0) pPlayerXp[%0] = 0

stock UpdatePlayerXP(playerid)
{
      new Str[20];
      format(Str, sizeof Str, "XP: %d", pPlayerXp[playerid]);
      TextDrawSetString(YourTextdrawID, Str);
}



Re: Help Me With Coin System - xFirex - 13.06.2013

san you make it to YSI ? or dini ?

EDIT: can you make it to YSI ? or dini ?