was ist hier falsch?? der healt sich immer selbst, AUCH wenn man ne andere ID als seine nimmt!
new cmd[256];
new tmp[256];
new idx;
new sendername[256];
new giveplayer[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/heal", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xBFC0C2FF, "INFO: /heal [playerid]");
return 1;
}
new playa;
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new Get1,Get2;
Get1 = GetPlayerVehicleID(playa);
Get2 = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) { return 1; }
if(!IsPlayerInAnyVehicle(playa)) { return 1; }
if(gTeam[playerid] == TEAM_MEDIC)
{
new formatX[256];
if(Get1 == Get2)
{
SetPlayerHealth(playa,100);
format(formatX,sizeof(formatX),"you has healed %s, %s",giveplayer,sendername);
SendClientMessage(playerid,0xBFC0C2FF,formatX);
SendClientMessage(playa,0xBFC0C2FF,formatX);
format(formatX,sizeof(formatX)," %s healed you, %s",sendername,giveplayer);
}
else
{
}
}
return 1;
}