11.05.2012, 15:25
Hey guys, how can I make so when a player from grove team kill a guy from balla the guy from the grove team gets +10 score and +15.000 money.
gTeam[playerid] = GROVE;
gTeam[playerid] = BALLA;
Do you have a variable like:
pawn Код:
pawn Код:
|
else if(classid == 1)
{
gTeam[playerid] = Balla;
GameTextForPlayer(playerid,"~pu~Balla",3000,5);
SetPlayerPos(playerid,2100.6926,1683.2804,13.0060);
SetPlayerCameraPos(playerid,2105.7258,1683.1344,12.9479);
SetPlayerCameraLookAt(playerid,2100.6926,1683.2804,13.0060);
SetPlayerFacingAngle(playerid,269.1398);
SetPlayerColor(playerid, COLOR_PURPLE);
}
else if(classid == 2)
{
gTeam[playerid] = Grove;
GameTextForPlayer(playerid,"~g~Grove",3000,5);
SetPlayerPos(playerid,2100.6926,1683.2804,13.0060);
SetPlayerCameraPos(playerid,2105.7258,1683.1344,12.9479);
SetPlayerCameraLookAt(playerid,2100.6926,1683.2804,13.0060);
SetPlayerFacingAngle(playerid,269.1398);
SetPlayerColor(playerid, COLOR_GREEN);
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[killerid] == Balla && gTeam[playerid] == Grove)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
GivePlayerMoney(playerid, GetPlayerMoney(killerid)+15000);
}
if(gTeam[killerid] == Grove && gTeam[playerid] == Balla)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
GivePlayerMoney(playerid, GetPlayerMoney(killerid)+15000);
}
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[killerid] == Balla && gTeam[playerid] == Grove)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
GivePlayerMoney(killerid, 15000);
}
if(gTeam[killerid] == Grove && gTeam[playerid] == Balla)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
GivePlayerMoney(killerid, 15000);
}
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPlayerScore(killerid, GetPlayerScore(killerid)+10);
GivePlayerMoney(killerid, 15000);
}
That's fine. All you need to do is this under
pawn Код:
|
(674) : warning 213: tag mismatch
if(gTeam[killerid] == Grove && gTeam[playerid] == Balla)
public OnPlayerDeath(playerid, killerid,reason)
{
if(killerid != INVALID_PLAYER_ID && gTeam[playerid] != gTeam[killerid])
{
GivePlayerMoney(killerid,15000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+10);
}
return 1;
}