/buylevel is not respon
#1

can you help me about this
my command /buylevel
PHP код:
CMD:buylevel(playeridparams[])
{
    new 
str[50],pName[MAX_PLAYER_NAME],pID;
    new 
score GetPlayerScore(playerid);
    if(
TelahLogin[playerid]==0) return SCM(playerid,warna_merah,"kamu belum login");
    if(
PlayerInfo[playerid][pExp] <= ) return SendClientMessage(playerid,warna_biru,"Exp kamu belum cukup untuk melakukan command ini");
    if(
PlayerInfo[playerid][pExp] == 8) {
        
GivePlayerMoney(playerid, -6000);
        
PlayerInfo[playerid][pExp] = 0;
        
SetPlayerScore(playerid,score+1);
        
PlayerInfo[playerid][pLevel] += 1;
        
format(str,sizeof(str),"[INFO] : Selamat kepada %s telah membeli 1 score total scorenya adalah %i",pName,PlayerInfo[pID][pLevel]);
        
SendClientMessageToAll(warna_hijau,str);
    }
    return 
1;

why cannot respon please can you fix it ?


Thanks Before
Reply
#2

Can you explain more please, I don't understand what is not working.
Reply
#3

Are you only allowed to use the command at level 8? As far as I can see, this code does nothing for players that are over level 8? ( if(PlayerInfo[playerid][pExp] == { )

If not, that if clause isn't necessary at all since you have already checked if they're below it and returned for that.
Reply
#4

Try this.
Код:
CMD:buylevel(playerid, params[])
{
    new str[50],pName[MAX_PLAYER_NAME],pID;
    new score = GetPlayerScore(playerid);
    if(TelahLogin[playerid]==0) return SCM(playerid,warna_merah,"kamu belum login");
    if(PlayerInfo[playerid][pExp] <= 8 ) return SendClientMessage(playerid,warna_biru,"Exp kamu belum cukup untuk melakukan command ini");
        GivePlayerMoney(playerid, -6000);
        PlayerInfo[playerid][pExp] = 0;
        SetPlayerScore(playerid,score+1);
        PlayerInfo[playerid][pLevel] += 1;
        format(str,sizeof(str),"[INFO] : Selamat kepada %s telah membeli 1 score total scorenya adalah %i",pName,PlayerInfo[pID][pLevel]);
        SendClientMessageToAll(warna_hijau,str);
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by Vin Diesel
Посмотреть сообщение
Try this.
Код:
CMD:buylevel(playerid, params[])
{
    new str[50],pName[MAX_PLAYER_NAME],pID;
    new score = GetPlayerScore(playerid);
    if(TelahLogin[playerid]==0) return SCM(playerid,warna_merah,"kamu belum login");
    if(PlayerInfo[playerid][pExp] <= 8 ) return SendClientMessage(playerid,warna_biru,"Exp kamu belum cukup untuk melakukan command ini");
        GivePlayerMoney(playerid, -6000);
        PlayerInfo[playerid][pExp] = 0;
        SetPlayerScore(playerid,score+1);
        PlayerInfo[playerid][pLevel] += 1;
        format(str,sizeof(str),"[INFO] : Selamat kepada %s telah membeli 1 score total scorenya adalah %i",pName,PlayerInfo[pID][pLevel]);
        SendClientMessageToAll(warna_hijau,str);
    }
    return 1;
}
its working thanks bro +rep
Reply
#6

You're welcome.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)