Guten Tag,
ich habe eine Frage wie schreibe ich die Pickup funktion am besten zu einen /Enter Befehl ?
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
if(GetPVarInt(playerid, "HousePickupCooldown") < gettime())
{
if(InHouse[playerid] == INVALID_HOUSE_ID) {
foreach(new i : Houses)
{
if(pickupid == HouseData[i][HousePickup])
{
SetPVarInt(playerid, "HousePickupCooldown", gettime() + HOUSE_COOLDOWN);
SetPVarInt(playerid, "PickupHouseID", i);
if(!strcmp(HouseData[i][Owner], "-")) {
new string[64];
format(string, sizeof(string), "{2ECC71}$%s", convertNumber(HouseData[i][Price]));
ShowPlayerDialog(playerid, DIALOG_BUY_HOUSE, DIALOG_STYLE_MSGBOX, "Haus zu verkaufen", string, "Kaufen", "Schließen");
}else{
if(HouseData[i][SalePrice] > 0 && strcmp(HouseData[i][Owner], Player_GetName(playerid)))
{
new string[64];
format(string, sizeof(string), "{2ECC71}$%s", convertNumber(HouseData[i][SalePrice]));
ShowPlayerDialog(playerid, DIALOG_BUY_HOUSE_FROM_OWNER, DIALOG_STYLE_MSGBOX, "Haus zu verkaufen", string, "Kaufen", "Schließen");
return 1;
}
switch(HouseData[i][LockMode])
{
case LOCK_MODE_NOLOCK: SendToHouse(playerid, i);
case LOCK_MODE_KEYS:
{
new gotkeys = Iter_Contains(HouseKeys[playerid], i);
if(!gotkeys) if(!strcmp(HouseData[i][Owner], Player_GetName(playerid))) gotkeys = 1;
if(gotkeys) {
SendToHouse(playerid, i);
}else{
SendClientMessage(playerid, 0xE74C3CFF, "Du besitzt keine Schlüssel für dieses Haus.");
}
}
case LOCK_MODE_OWNER:
{
if(!strcmp(HouseData[i][Owner], Player_GetName(playerid))) {
SetPVarInt(playerid, "HousePickupCooldown", gettime() + HOUSE_COOLDOWN);
SendToHouse(playerid, i);
}else{
SendClientMessage(playerid, 0xE74C3CFF, "Nur der Besitzer kann dieses Haus betreten");
}
}
}
}
}
}
}else{
for(new i; i < sizeof(HouseInteriors); ++i)
{
if(pickupid == HouseInteriors[i][intPickup])
{
SetPVarInt(playerid, "HousePickupCooldown", gettime() + HOUSE_COOLDOWN);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, HouseData[ InHouse[playerid] ][houseX], HouseData[ InHouse[playerid] ][houseY], HouseData[ InHouse[playerid] ][houseZ]);
InHouse[playerid] = INVALID_HOUSE_ID;
return 1;
}
}
} }
Danke