alles falsch
ocmd:heal(playerid,params[])
{
for(new i = 0; i < sizeof(MedicCars); i++) //Statt MedicCars die Variable nehmen die du für die Krankenhaus Fahrzeuge genommen hast
{
if(!IsAMedicCar(i) && i == sizeof(MedicCars)-1) //Ungetestet!
return SendClientMessage(playerid,rot,"Du bist in keinem Krankenhaus-Fahrzeug!");
new pID, string[128], money, namepID[MAX_PLAYER_NAME], nameplayerid[MAX_PLAYER_NAME];
if(!isPlayerInFrakt(playerid,2))return 0;
if(sscanf(params,"ui", pID, money))return SendClientMessage(playerid, Hellblau, "Benutze: /heal [Spieler-ID] [Preis]");
if(GetPlayerMoney(pID) < money)return SendClientMessage(playerid, Gruen, "Der Spieler hat nicht genügend Geld");
SetPlayerHealth(pID, 100);
GivePlayerMoney(playerid, money);
GivePlayerMoney(pID, -money);
GetPlayerName(pID, namepID, MAX_PLAYER_NAME);
GetPlayerName(playerid, nameplayerid, MAX_PLAYER_NAME);
format(string, sizeof(string), "Du hast %s für $%d geheilt.", namepID, money);
SendClientMessage(playerid, Orange, string);
format(string, sizeof(string), "Du wurdest von Medic %s für %d$ geheilt.", nameplayerid, money);
SendClientMessage(pID, Orange, string);
return 1;
}
return 1;
}