16.04.2009, 16:52
I want to make a Ranking System in my GangMode, but I get Errors like that "error 033: array must be indexed (variable "name2")"...the same with
variable "KillScore" and "DeathScore"...
Here is the pawn---->
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/rank",cmdtext,true) == 0)
{
GetPlayerName(playerid,name2,sizeof(name2));
format(string,sizeof(string),"You have %d Kills",KillScore[name2]);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"You Died %d Times",DeathScore[name2]);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
if(KillScore == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Murder");
}
else if(KillScore == 2)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->P.I.M.P");
}
else if(KillScore == 3)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Ganxsta");
}
else if(KillScore == 4)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->GangLeader");
}
else if(KillScore == 5)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->2 Pac");
}
else if(KillScore == 6)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->HoodGOD");
SendClientMessage(playerid,COLOR_YELLOW,"!You Have Reached the Highest Rank!");
}
else if(KillScore >= 6)
{
}
else if(DeathScore == 0 && DeathScore == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Pussy");
}
else if(DeathScore >= 2)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Victim");
}
return 0;
}
MFG Bearfist
variable "KillScore" and "DeathScore"...
Here is the pawn---->
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/rank",cmdtext,true) == 0)
{
GetPlayerName(playerid,name2,sizeof(name2));
format(string,sizeof(string),"You have %d Kills",KillScore[name2]);
SendClientMessage(playerid,COLOR_YELLOW,string);
format(string,sizeof(string),"You Died %d Times",DeathScore[name2]);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
if(KillScore == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Murder");
}
else if(KillScore == 2)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->P.I.M.P");
}
else if(KillScore == 3)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Ganxsta");
}
else if(KillScore == 4)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->GangLeader");
}
else if(KillScore == 5)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->2 Pac");
}
else if(KillScore == 6)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->HoodGOD");
SendClientMessage(playerid,COLOR_YELLOW,"!You Have Reached the Highest Rank!");
}
else if(KillScore >= 6)
{
}
else if(DeathScore == 0 && DeathScore == 1)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Pussy");
}
else if(DeathScore >= 2)
{
SendClientMessage(playerid,COLOR_YELLOW,"Your Rank Is-->Victim");
}
return 0;
}
MFG Bearfist