01.08.2012, 17:33
Thats the whole code AND
this part only register a score when a player kills another, and i want it to get the score even if its a truck mission.
Running a trucking server.
(And i can complie it without errors, even run it in the server. But only counts kill score.)
Something with OnPlayerUpdate but can not figure it out
this part only register a score when a player kills another, and i want it to get the score even if its a truck mission.
Running a trucking server.
(And i can complie it without errors, even run it in the server. But only counts kill score.)
Something with OnPlayerUpdate but can not figure it out
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
if(GetPlayerScore(killerid) == 1) // Amount of required kills to get rank 1 *Baby Killa'*
{
GetPlayerName(killerid, string, sizeof(string) );
format(string, sizeof(string), ">> %s advanced to rank *Rookie Trucker*", string, GetPlayerScore(killerid) );
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
pRank[playerid] = 1;
}
else if(GetPlayerScore(killerid) == 20) // Amount of required kills to get rank 2 *Soldier*
{
GetPlayerName(killerid, string, sizeof(string) );
format(string, sizeof(string), ">> %s advanced to rank *Trucker*", string, GetPlayerScore(killerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
pRank[playerid] = 2;
}
else if(GetPlayerScore(killerid) == 100) // Amount of required kills to get rank 3 *Gangsta'*
{
GetPlayerName(killerid, string, sizeof(string) );
format(string, sizeof(string), ">> %s advanced to rank *Respected Trucker*", string, GetPlayerScore(killerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
pRank[playerid] = 3;
}
else if(GetPlayerScore(killerid) == 250) // Amount of required kills to get rank 4 *Underboss*
{
GetPlayerName(killerid, string, sizeof(string) );
format(string, sizeof(string), ">> %s advanced to rank *Trucker Of The Year*", string, GetPlayerScore(killerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
pRank[playerid] = 4;
}
else if(GetPlayerScore(killerid) == 500) // Amount of required kills to get rank 5 *Tha' Boss*
{
GetPlayerName(killerid, string, sizeof(string) );
format(string, sizeof(string), ">> %s advanced to rank *Most Valued Trucker*", string, GetPlayerScore(killerid));
SendClientMessageToAll(COLOR_LIGHTBLUE, string);
pRank[playerid] = 5;
}
return 1;
}

