01.02.2014, 16:10
Hello samp members i wanna to make this (image from AVT) and when some team lets say terrorist have 150 kills all kills reset and winner team gets 25 score , same for army . can i get code bec i cant find on ******
new ArmyP;
new TerrP;
//under OnPlayerDeath
if(gTeam[playerid][TEAM_ARMY] == 1)
Terrp = +1;
if(gTeam[playerid][TEAM_TERRORIST] == 1)
Armyp = +1;
//then below the OnPlayerUpdate
if(Armyp == 150)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i][TEAM_ARMY)
{
SetPlayerScore(i, GetPlayerScore(i)+25)
}
}
}
}
if(Terrp == 150)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(gTeam[i][TEAM_TERRORIST)
{
SetPlayerScore(i, GetPlayerScore(i)+25)
}
}
}
}
first make a global variable
pawn Код:
|
Terrp = +1;
++Terrp;
// OR
Terrp++;
// OR
Terrp += 1;
// OR
Terrp = Terrp + 1;
No offense, but it's bad coded. Killing your own teammates would count as valid kill (abusive) plus using OnPlayerUpdate for something such as this is horrible.
pawn Код:
pawn Код:
|
if(gTeam[playerid][TEAM_TERRORIST] == 1 && gTeam[killerid][TEAM_ARMY])
{
..............................
//and so on