26.05.2011, 16:27
I guess this is also worng(sorry until now evrything I have done was commands for 2 players wich is easy but something that doesnt inlcudes command I haven't done yet):
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
new playerid2 = i;
if(gTeam[playerid2] == TEAM_MEDICS)
{
if(GetPlayerState(playerid2) == PLAYER_STATE_DRIVER && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
GetVehicleModel(vehicleid);
if(vehicleid == 416)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 80)
{
SetPlayerHealth(playerid,100);
GivePlayerMoney(playerid,-500);
GivePlayerMoney(playerid2,500);
SetPlayerScore(playerid2,GetPlayerScore(playerid2) + 2);
new medicname[24];
new healedname[24];
new string[128];
GetPlayerName(playerid,healedname,sizeof(healedname));
GetPlayerName(playerid2,medicname,sizeof(medicname));
format(string,sizeof(string),"%s has been healed by medic %s.",healedname,medicname);
SendClientMessageToAll(COLOR_GREY,string);
}
}
}
}
}
return 1;
}