23.04.2011, 06:10
guys help me how i make this plz give me code

#include <a_samp>
new top5[5][2];
stock GetP1()
{
new HighestScore = cellmin, LastHighest = INVALID_PLAYER_ID;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(GetPlayerScore(i) > HighestScore){
HighestScore = GetPlayerScore(i);
LastHighest = i;
}
}
return top5[0][0] = LastHighest, top5[0][1] = HighestScore;
}
stock GetP2()
{
new HighestScore = cellmin, LastHighest = INVALID_PLAYER_ID;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if((GetPlayerScore(i) > HighestScore) && (GetPlayerScore(i) < top5[0][1])){
HighestScore = GetPlayerScore(i);
LastHighest = i;
}
}
return top5[1][0] = LastHighest, top5[1][1] = HighestScore;
}
stock GetP3()
{
new HighestScore = cellmin, LastHighest = INVALID_PLAYER_ID;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if((GetPlayerScore(i) > HighestScore) && (GetPlayerScore(i) < top5[1][1])){
HighestScore = GetPlayerScore(i);
LastHighest = i;
}
}
return top5[2][0] = LastHighest, top5[2][1] = HighestScore;
}
stock GetP4()
{
new HighestScore = cellmin, LastHighest = INVALID_PLAYER_ID;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if((GetPlayerScore(i) > HighestScore) && (GetPlayerScore(i) < top5[2][1])){
HighestScore = GetPlayerScore(i);
LastHighest = i;
}
}
return top5[3][0] = LastHighest, top5[3][1] = HighestScore;
}
stock GetP5()
{
new HighestScore = cellmin, LastHighest = INVALID_PLAYER_ID;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if((GetPlayerScore(i) > HighestScore) && (GetPlayerScore(i) < top5[3][1])){
HighestScore = GetPlayerScore(i);
LastHighest = i;
}
}
return top5[4][0] = LastHighest, top5[4][1] = HighestScore;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/top5")){
new str[128], pName[5][MAX_PLAYER_NAME];
GetP1();
GetP2();
GetP3();
GetP4();
GetP5();
GetPlayerName(top5[0][0], pName[0], MAX_PLAYER_NAME);
GetPlayerName(top5[1][0], pName[1], MAX_PLAYER_NAME);
GetPlayerName(top5[2][0], pName[2], MAX_PLAYER_NAME);
GetPlayerName(top5[3][0], pName[3], MAX_PLAYER_NAME);
GetPlayerName(top5[4][0], pName[4], MAX_PLAYER_NAME);
format(str, 128, "Nr.1: %s || Nr.2: %s || Nr.3: %s || Nr.4: %s || Nr.5: %s", pName[0], pName[1], pName[2], pName[3], pName[4]);
SendClientMessageToAll(0xFFFFFFAA, str);
}
return 1;
}