Hier mein /heal befehl:
if(strcmp(strget(cmdtext,0),"/heal",true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(Haus); i++)
{
if (IsPlayerInRangeOfPoint(playerid,10.0,Haus[ix], Haus[iy], Haus[iz]))
{
if(Haus[heal] == 1)
{
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
SetPlayerHealth(playerid,100.0);
format(string,sizeof(string),"Du hast dich geheilt.");
return SendClientMessage(playerid,COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Das Haus hat kein Healupgrade!");
}
}
}
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /heal [ID/NAME] [Preis]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 200) { SendClientMessage(playerid, COLOR_GREY, " Behandlungspreis nicht weniger als: 1$ und höher als 200$ !"); return 1; }
if (giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du kannst dich leider nicht selber Heilen!");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
//new giveambu = GetPlayerVehicleID(giveplayerid);
new playambu = GetPlayerVehicleID(playerid);
if(IsPlayerInFrac(playerid, 4))//model
{
if (IsPlayerInFrac(playerid, 4))
{
if(IsPlayerInVehicle(giveplayerid,playambu))
{
new Float:tempheal;
GetPlayerHealth(giveplayerid,tempheal);
if(tempheal >= 160)
{
SendClientMessage(playerid, COLOR_GREEN,"Diese Person ist schon Geheilt.");
return 1;
}
format(string, sizeof(string), "~y~Du heilst: ~n~~w~%s~n~~g~$%d", giveplayer,moneys);
GameTextForPlayer(playerid, string, 5000, 1);
P_GivePlayerMoney(playerid,moneys);
P_GivePlayerMoney(giveplayerid,-moneys);
SetPlayerHealth(giveplayerid, 100);
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Du wurdest für $%d geheilt.",moneys);
SendClientMessage(giveplayerid, COLOR_GREEN,string);
if(STDPlayer[giveplayerid] > 0)
{
STDPlayer[giveplayerid] = 0;
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "* Du bist nun nicht mehr an STD erkrankt. Die Ärzte konnten dich retten! !");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Spieler nicht in dien Wagen!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nicht im Rettungswagen / Rettungshelikopter!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du darfst diesen Befehl nicht benutzen !");
return 1;
}
}
}
else
{
format(string, sizeof(string), " %d ist kein aktiver Spieler.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
return 1;
}
Das funktioniert nur so nicht, kann mir jemand helfen
Mfg.