Hallo Community,
ich habe folgendes Problem, sobald ein Medic einen Spieler der im Krankenwagen sitzt heilen möchte erschein die Fehlermeldung: "Server: Unknown Command" <-- Ich habe keine Ahnung woran das liegen könnte, ich hoffe es kann mir wer helfen !
if(strcmp(cmd, "/heal", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new house;
PlayerInfo[playerid][pLocal] = house;
new location = PlayerInfo[playerid][pLocal];
if(!strlen(tmp))
{
if(location != 255)
{
if(location == 101)//Restaurant
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if ( tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Du wurdest vollstndig geheilt.");
SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
}
else
{
SendClientMessage(playerid, TEAM_GREEN_COLOR,"Du hast schon volles Leben.");
}
}
else if(location == 102 && IsACop(playerid))//Police Armoury
{
format(string, sizeof(string), "* %s hat sich seine Rstung angezogen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /heal [playerid] [preis]");
return 1;
}
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /heal [playerid] [preis]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 1000) { SendClientMessage(playerid, COLOR_GREY, " Der Preis muss zwischen 1 und 1000 liegen !"); return 1; }
if (giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du kannst dich nicht selbst 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(gTeam[playerid] == TEAM_CYAN||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)//model
{
if (IsAnAmbulance(playambu) && playambu == giveambu)
{
new Float:tempheal;
GetPlayerHealth(giveplayerid,tempheal);
if(tempheal >= 100.0)
{
SendClientMessage(playerid, TEAM_GREEN_COLOR," 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);
PlayerMoney[playerid] = PlayerMoney[playerid]+moneys;
PlayerMoney[giveplayerid] = PlayerMoney[giveplayerid]-moneys;
new hp = 0;
if(PlayerInfo[playerid][pPainPerk] > 0)
{
hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100;
SetPlayerHealth(giveplayerid, hp);
}
else
{
hp = 100;
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 auf %d Energie geheilt -$%d",hp,moneys);
SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
if(STDPlayer[giveplayerid] > 0)
{
STDPlayer[giveplayerid] = 0;
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "*Du bist nun nicht mehr an Aids erkrankt die Ärtzte konnten dich retten!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nicht im Krankenwagen / Heli !");
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;
}
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new house;
PlayerInfo[playerid][pLocal] = house;
new location = PlayerInfo[playerid][pLocal];
if(!strlen(tmp))
{
if(location != 255)
{
if(location == 101)//Restaurant
{
new Float:tempheal;
GetPlayerHealth(playerid,tempheal);
if ( tempheal < 100.0)
{
SetPlayerHealth(playerid,100.0);
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "Du wurdest vollstndig geheilt.");
SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
}
else
{
SendClientMessage(playerid, TEAM_GREEN_COLOR,"Du hast schon volles Leben.");
}
}
else if(location == 102 && IsACop(playerid))//Police Armoury
{
format(string, sizeof(string), "* %s hat sich seine Rstung angezogen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /heal [playerid] [preis]");
return 1;
}
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "FEHLER: /heal [playerid] [preis]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 1000) { SendClientMessage(playerid, COLOR_GREY, " Der Preis muss zwischen 1 und 1000 liegen !"); return 1; }
if (giveplayerid == playerid)
{
SendClientMessage(playerid, COLOR_GRAD1, " Du kannst dich nicht selbst 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(gTeam[playerid] == TEAM_CYAN||PlayerInfo[playerid][pMember]==4||PlayerInfo[playerid][pLeader]==4)//model
{
if (IsAnAmbulance(playambu) && playambu == giveambu)
{
new Float:tempheal;
GetPlayerHealth(giveplayerid,tempheal);
if(tempheal >= 100.0)
{
SendClientMessage(playerid, TEAM_GREEN_COLOR," 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);
PlayerMoney[playerid] = PlayerMoney[playerid]+moneys;
PlayerMoney[giveplayerid] = PlayerMoney[giveplayerid]-moneys;
new hp = 0;
if(PlayerInfo[playerid][pPainPerk] > 0)
{
hp = 20 * PlayerInfo[playerid][pPainPerk]; hp += 100;
SetPlayerHealth(giveplayerid, hp);
}
else
{
hp = 100;
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 auf %d Energie geheilt -$%d",hp,moneys);
SendClientMessage(giveplayerid, TEAM_GREEN_COLOR,string);
if(STDPlayer[giveplayerid] > 0)
{
STDPlayer[giveplayerid] = 0;
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, "*Du bist nun nicht mehr an Aids erkrankt die Ärtzte konnten dich retten!");
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nicht im Krankenwagen / Heli !");
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;
}
Mit freundlichen Grüßen,
Beastmode