Hey Leute, Wie mach ich Das man /sellhotdog id preis machen muss?
Ausserdem Sollte der befehl nur am Hotdogstand gehen oder im Hotdog Van
if(strcmp(cmd, "/sellhotdog", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] == 20)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GREY,"USAGE: /sellhotdog [playerid]");
return 1;
}
gPlayer = strval(tmp);
if(IsPlayerConnected(gPlayer))
{
if(GetDistanceBetweenPlayers(playerid,gPlayer) < 2)
{
new Float:HP; GetPlayerHealth(gPlayer,HP);
if(HP > 90)
{
SendClientMessage(playerid,COLOR_GREY,"* Dieser Spieler hat volle HP und keinen Hunger!");
return 1;
}
GetPlayerName(playerid, pName, sizeof(pName));
GetPlayerName(gPlayer, gName, sizeof(gName));
format(string, sizeof(string), "* Hotdog Verkäufer %s verkauft einen Hotdog an %s.", pName,gName);
ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetPlayerHealth(gPlayer,HP+25);
GivePlayerMoney(playerid, -50);
} else {
SendClientMessage(playerid,COLOR_GREY,"* Du bist zu weit entfernt!");
}
} else {
SendClientMessage(playerid,COLOR_GREY,"* Spieler Offline!");
}
} else {
SendClientMessage(playerid,COLOR_GREY,"* Du bist kein HotDog Verkäufer!");
}
}
return 1;
}
Hier der Stand
if(strcmp(cmdtext, "/Standaufbauen", true)==0)
{
if (PlayerInfo[playerid][pJob] != 20) return SendClientMessage(playerid, COLOR_GREY, "Du bist kein Hot Dog Verkäufer!");
if (PlayerInfo[playerid][pStand] != 0) return SendClientMessage(playerid, COLOR_GREY, "Du kannst nur einen HotDog Stand.");
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
PlayerInfo[playerid][pStand] = CreateObject(1340, X+1, Y, Z, 0.0, 0.0, A+180);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[playerid][pJob] != 20)
{
SetPlayerCheckpoint(playerid, X, Y, Z-10, 1.0);
}
}
}
return 1;
}
Thanks!