SA-MP Forums Archive
GivePlayerXP ??? - 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: GivePlayerXP ??? (/showthread.php?tid=513877)



GivePlayerXP ??? - rockhopper - 18.05.2014

I wanna make a thing like GivePlayerCash so what do i use i wanna make GivePlayerXP SetPlayerXP GivePlayerRank with saving also so please can someone give me ideas ?


Re: GivePlayerXP ??? - SPA - 18.05.2014

Xp you meaning Score?


Re: GivePlayerXP ??? - ZachKnoxx - 18.05.2014

If you've included 'ZCMD' and also 'sscanf2'

Add this at the bottom of the script
pawn Код:
#include "zcmd"
#include "sscanf2"

Below OnPlayerCommandText
pawn Код:
COMMAND:xp(playerid, params[])
{
    if(PlayerAcc[playerid][AdminLevel] >= 4) // change this to the ranks of your admin.
    {
        new target;
        new amount;
        if(sscanf(params, "ud", target, amount)
        {
            new str[128];
            format(str, sizeof(str), "Your XP has been set to %d .", amount);
            SendClientMessage(playerid, 0xFFFFFFF, str);
            PlayerAcc[playerid][xp] == amount; //change to the way your system works
        }
        else SendClientMessage(playerid, -1, "USAGE: /xp [playerid/partofname] [amount of xp]");
    }
    else SendClientMessage(playerid, -1, "This command does not exist in our database.");
    return 1;
}
I didn't quite know what you're asking for, but here you go.


Re: GivePlayerXP ??? - rockhopper - 18.05.2014

I mean a new xp fuction that save means if a player has 500 Xp he will get some weapon
etc etc


Re: GivePlayerXP ??? - Sojo12 - 18.05.2014

Well the function to give XP is
Код:
IncreasePlayerXP(playerid,amount);



Re: GivePlayerXP ??? - rockhopper - 18.05.2014

Yes something like that but what do i use Stock


Re: GivePlayerXP ??? - NaClchemistryK - 18.05.2014

Just use the score. The scores are something like XPs. Function to check what the player score is is GetPlayerScore. Function for setting a player's score is SetPlayerScore. As I said, Score is nothing else than XP. If you really want your own XP system so badly, use ysi/yini.
Quote:
pawn Код:
PlayerAcc[playerid][xp] == amount; //change to the way your system works
I don't think he has his own system. If then he wouldn't be asking.


Re: GivePlayerXP ??? - rockhopper - 18.05.2014

I want a function like SetPlayerScore etc


Re: GivePlayerXP ??? - Sojo12 - 18.05.2014

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Yes something like that but what do i use Stock
Yea,you should create stock before using this.


Re: GivePlayerXP ??? - RajatPawar - 18.05.2014

Quote:
Originally Posted by ZachKnoxx
Посмотреть сообщение
If you've included 'ZCMD' and also 'sscanf2'

..

[/pawn]
Yep, just post random code without caring if those variables and enums even exist in his script or not! And ZCMD commands are separate functions.

Quote:
Originally Posted by Sojo12
Посмотреть сообщение
Well the function to give XP is
Код:
IncreasePlayerXP(playerid,amount);
:/

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Yes something like that but what do i use Stock
All stocks are functions, but not ALL functions are stocks - if ****** read this, he'd go ballistic or something, as he has on the recent posts regarding the same topic.

Lastly, you can download this and check for HOW it runs, is coded and you could try replicating it on your own. It's really easy.