2 problems (admins can't see report & Killstreaks)
#1

2 problems here in my script.
1) Admins can't see the reports.
pawn Код:
CMD:report(playerid,params[])
{
    new reportedid, reporter[MAX_PLAYER_NAME],reportedname[MAX_PLAYER_NAME],str1[128],str2[128], reason[128];
    if(sscanf(params,"us[128]",reportedid,reason)) return SCM(playerid,COLOR_RED,"[USAGE] /Report [ID] [Reason]");
    if(reportedid == playerid) return SCM(playerid,COLOR_RED,"You can't report yourself!");
    if(reportedid == INVALID_PLAYER_ID) return SCM(playerid,COLOR_RED,"Player is not online!");
    else{
    GetPlayerName(playerid,reporter,sizeof(reporter));
    GetPlayerName(reportedid,reportedname,sizeof(reportedname));
    format(str1,sizeof(str1),"* %s(%d) has reported %s(%d) (Reason: %s)",reporter,playerid,reportedname,reportedid,reason);
    format(str2,sizeof(str2),"* You have reported %s(%d) (Reason: %s)",reportedname,reportedid,reason);
    SCM(playerid,COLOR_YELLOW,str2);
    if(IsPlayerAdmin(playerid))
    {
        SCM(playerid,COLOR_RED,str1);
        return 1;
    }}
    return 1;
}
2) KillStreaks is not working
pawn Код:
new KillStreak[MAX_PLAYERS]; // at the top
public OnPlayerDeath(playerid, killerid, reason)
{
    KillStreak[playerid]++;
    KillStreak[playerid] = 0;
    if(KillStreak[playerid] == 1)
    {
        SetPlayerWantedLevel(playerid,1);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
        return 1;
    }
    if(KillStreak[playerid] == 2)
    {
        SetPlayerWantedLevel(playerid,2);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
        return 1;
    }
    if(KillStreak[playerid] == 3)
    {
        SetPlayerWantedLevel(playerid,3);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+2);
        return 1;
    }
    if(KillStreak[playerid] == 4)
    {
        SetPlayerWantedLevel(playerid,4);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+3);
        return 1;
    }
    if(KillStreak[playerid] == 5)
    {
        SetPlayerWantedLevel(playerid,5);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+4);
        return 1;
    }
    if(KillStreak[playerid] == 6)
    {
        SetPlayerWantedLevel(playerid,6);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
        return 1;
    }
    return 1;
}
No wanted star and no score given.
Reply
#2

pawn Код:
CMD:report(playerid,params[])
{
    new reportedid, reporter[MAX_PLAYER_NAME],reportedname[MAX_PLAYER_NAME],str1[128],str2[128], reason[128];
    if(sscanf(params,"us[128]",reportedid,reason)) return SCM(playerid,COLOR_RED,"[USAGE] /Report [ID] [Reason]");
    if(reportedid == playerid) return SCM(playerid,COLOR_RED,"You can't report yourself!");
    if(reportedid == INVALID_PLAYER_ID) return SCM(playerid,COLOR_RED,"Player is not online!");
    GetPlayerName(playerid,reporter,sizeof(reporter));
    GetPlayerName(reportedid,reportedname,sizeof(reportedname));
    format(str1,sizeof(str1),"* %s(%d) has reported %s(%d) (Reason: %s)",reporter,playerid,reportedname,reportedid,reason);
    format(str2,sizeof(str2),"* You have reported %s(%d) (Reason: %s)",reportedname,reportedid,reason);
    SCM(playerid,COLOR_YELLOW,str2);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerAdmin(i)) continue;
        SCM(i, COLOR_RED, str1);
    }
    return 1;
}
#EDIT
And:
pawn Код:
new KillStreak[MAX_PLAYERS]; // at the top
public OnPlayerDeath(playerid, killerid, reason)
{
    KillStreak[killerid]++;
    KillStreak[playerid] = 0;
    if(KillStreak[killerid] > 0)
    {
        SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
        SetPlayerScore(killerid, GetPlayerScore(killerid)+KillStreak[killerid]);
        return 1;
    }
    return 1;
}
#EDITED
#EDITEDІ LOL
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    KillStreak[playerid]++;
    KillStreak[playerid] = 0;
    if(KillStreak[playerid] == 1)

lol, KillStreak[playerid] will always be 0, you need to remove KillStreak[playerid] = 0;from there and put it on OnPlayerDisconnect or something like that.

pawn Код:
new KillStreak[MAX_PLAYERS]; // at the top
public OnPlayerDeath(playerid, killerid, reason)
{
    KillStreak[playerid]++;
    if(KillStreak[playerid] == 1)
    {
        SetPlayerWantedLevel(playerid,1);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
        return 1;
    }
    if(KillStreak[playerid] == 2)
    {
        SetPlayerWantedLevel(playerid,2);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+1);
        return 1;
    }
    if(KillStreak[playerid] == 3)
    {
        SetPlayerWantedLevel(playerid,3);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+2);
        return 1;
    }
    if(KillStreak[playerid] == 4)
    {
        SetPlayerWantedLevel(playerid,4);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+3);
        return 1;
    }
    if(KillStreak[playerid] == 5)
    {
        SetPlayerWantedLevel(playerid,5);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+4);
        return 1;
    }
    if(KillStreak[playerid] == 6)
    {
        SetPlayerWantedLevel(playerid,6);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+5);
        return 1;
    }
    return 1;
}

OnPlayerDisconnect(playerid, reason) {
    KillStreak[playerid] = 0;
}
Reply
#4

Quote:
Originally Posted by Mandrakke
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    KillStreak[playerid]++;
    KillStreak[playerid] = 0;
    if(KillStreak[playerid] == 1)

lol, KillStreak[playerid] will always be 0, you need to remove KillStreak[playerid] = 0;from there and put it on OnPlayerDisconnect or something like that.
No, he just forgot that there killerid this callback .
Reply
#5

Admins still can't see the report.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)