28.05.2012, 17:25
2 problems here in my script.
1) Admins can't see the reports.
2) KillStreaks is not working
No wanted star and no score given.
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;
}
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;
}