Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- enum pInfo
- {
- Level,
- Exp,
- }
- new levelexp = 1;
- new PlayerInfo[MAX_PLAYERS][pInfo];
- CMD:levelup(playerid,params[])
- {
- new string[30];
- if(IsPlayerConnected(playerid) == 1)
- {
- new points[248];
- new nxtlevel = PlayerInfo[playerid][Level]+1;
- new expamount = nxtlevel*levelexp;
- if(PlayerInfo[playerid][Exp] < expamount)
- {
- format(points,sizeof(points)," {FF0000}You need {0066CC}%d {FF0000}exp. points. You currently have {15FF00} %d",expamount,PlayerInfo[playerid][Exp]); // Format, to send to that player message
- SendClientMessage(playerid,-1,points);
- return 1;
- }
- else
- {
- PlayerInfo[playerid][Exp] = 0;
- PlayerInfo[playerid][Level]++;
- format(string,sizeof(string),"~g~Your now level: ~r~%d",PlayerInfo[playerid][Level]);
- GameTextForPlayer(playerid,string,6000,1);
- return 1;
- }
- }
- return 1;
- }
- CMD:level(playerid,params[])
- {
- new string2[200];
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string2,sizeof(string2),"{FF0000}Name: {15FF00}%s \n{FF0000}Level: {15FF00}%d\n{FF0000}Exp: {15FF00}%d\n\n{FF0000}This is your {15FF00}Level Stats!",name,PlayerInfo[playerid][Level],PlayerInfo[playerid][Exp]);
- ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"{15FF00}Level",string2,"Close","");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement