Hey Brotfischer.
Ich habe ein Problem mit /Heal.
Und zwar kann man den Befehl überall benutzen.
if(strcmp(cmd, "/heal", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new location = PlayerInfo[playerid][pLocal];
if(!strlen(tmp))
{
if(location != 999)
{
if(location < 254)
{
if(HouseInfo[location][hHel] == 1)
{
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), "* %s hat sich geheilt",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "* %s hat sich geheilt",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
format(string, sizeof(string), "Dieses Haus hat kein Heal Upgrade.");
SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
}
if(HouseInfo[location][hArm] == 1)
{
SetPlayerArmour(playerid,100.0);
PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s hat sich eine rüstung angezogen.",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
format(string, sizeof(string), "Dieses Haus hat kein Armor Upgrade.");
SendClientMessage(playerid, TEAM_GREEN_COLOR,string);
}
return 1;
}
//else if(location == 101 && IsInBiz[playerid] == 1)//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), "* %s hat sich geheilt",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
SendClientMessage(playerid, TEAM_GREEN_COLOR,"Du hast bereits 100Hp");
}
}
//else if(location == 102 && IsACop(playerid))//Police Armoury
{
SetPlayerHealth(playerid,100.0);
SetPlayerArmour(playerid,100.0);
format(string, sizeof(string), "* %s legt die Schutzweste an.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(playerid,0);
GetPlayerPos(playerid, Unspec[playerid][sPx], Unspec[playerid][sPy], Unspec[playerid][sPz]);
Unspec[playerid][sPint] = PlayerInfo[playerid][pInt];
Unspec[playerid][sLocal] = PlayerInfo[playerid][pLocal];
SetPlayerPos(playerid,1527.5,-12.1,1002.0);
PlayerInfo[playerid][pLocal] = 999;
SetPlayerInterior(playerid,99);
Spectate[playerid] = 257;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutze: /heal [ID/NAME] [Preis]");
return 1;
}
}
Kann mir einer so Machen, das man nur in einem Haus den Befehl benutzen kann?
Danke im Vorraus, MfG.