new propid = IsPlayerNearProperty(playerid);if(propid == -1){ SendClientMessage(playerid, 0xFF0000AA, \"Itt nem tudsz ingatlant venni.\"); return 1;}if(PlayerProps[playerid] == MAX_PROPERTIES_PER_PLAYER) { format(str, 128, \"Neked már van: %d ingatlanod, így nem tudsz többet vásárolni.\", PlayerProps[playerid]); SendClientMessage(playerid, 0xFF0000AA, str); return 1;}if(PropInfo[propid][PropIsBought] == 1){ new ownerid = GetPlayerID(PropInfo[propid][PropOwner]); if(ownerid == playerid) { SendClientMessage(playerid, 0xFF0000AA, \"Ez az épület már a tiéd!\"); return 1; } else { if(PropInfo[propid][PropUnbuyableTime] > 0) { format(str, 128, \"Az ingatlant megvásárolta: %s. Várj %d-t!.\", PropInfo[propid][PropOwner], PropInfo[propid][PropUnbuyableTime]); SendClientMessage(playerid, 0xFF0000AA, str); return 1; } }}if(GetPlayerMoney(playerid) < PropInfo[propid][PropValue]){ format(str, 128, \"Nincs elég pénzed. Pénzed: $%d,-\", PropInfo[propid][PropValue]); SendClientMessage(playerid, 0xFF0000AA, str); return 1;}new pName[MAX_PLAYER_NAME];GetPlayerName(playerid, pName, sizeof(pName));if(PropInfo[propid][PropIsBought] && PropInfo[propid][PropUnbuyableTime] == 0){ new ownerid = GetPlayerID(PropInfo[propid][PropOwner]); format(str, 128, \"%s megvásárolta a következõ ingatlant: \\\"%s\\\". Te ennyit keresel vele:($%d)\", pName, PropInfo[propid][PropName], (PropInfo[propid][PropValue]/2)); GivePlayerMoney(ownerid, (PropInfo[propid][PropValue]/2)); SendClientMessage(ownerid, 0xFFFF00AA, str); PlayerProps[ownerid]--;}PropInfo[propid][PropOwner] = pName;PropInfo[propid][PropIsBought] = 1;PropInfo[propid][PropUnbuyableTime] = UNBUYABLETIME;EarningsForPlayer[playerid] += PropInfo[propid][PropEarning]; GivePlayerMoney(playerid, (0-PropInfo[propid][PropValue]));format(str, 128, \"Megvásároltad a következõ ingatlant: \\\"%s\\\" ennyiért: $%d\", PropInfo[propid][PropName], PropInfo[propid][PropValue]); SendClientMessage(playerid, 0xFFFF00AA, str); format(str, 128, \"%s megvásárolta a következõ ingatlant: \\\"%s\\\" ennyiért: $%d.\", pName, PropInfo[propid][PropName], PropInfo[propid][PropValue]); SendClientMessageToAllEx(playerid, 0xFFFF00AA, str); PlayerProps[playerid]++;return 1;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ if(dialogid == 1 && response) //Helyetesítsd be az id-t {new propid = IsPlayerNearProperty(playerid);if(propid == -1){ SendClientMessage(playerid, 0xFF0000AA, \"Itt nem tudsz ingatlant venni.\"); return 1;}if(PlayerProps[playerid] == MAX_PROPERTIES_PER_PLAYER) { format(str, 128, \"Neked már van: %d ingatlanod, így nem tudsz többet vásárolni.\", PlayerProps[playerid]); SendClientMessage(playerid, 0xFF0000AA, str); return 1;}if(PropInfo[propid][PropIsBought] == 1){ new ownerid = GetPlayerID(PropInfo[propid][PropOwner]); if(ownerid == playerid) { SendClientMessage(playerid, 0xFF0000AA, \"Ez az épület már a tiéd!\"); return 1; } else { if(PropInfo[propid][PropUnbuyableTime] > 0) { format(str, 128, \"Az ingatlant megvásárolta: %s. Várj %d-t!.\", PropInfo[propid][PropOwner], PropInfo[propid][PropUnbuyableTime]); SendClientMessage(playerid, 0xFF0000AA, str); return 1; } }}if(GetPlayerMoney(playerid) < PropInfo[propid][PropValue]){ format(str, 128, \"Nincs elég pénzed. Pénzed: $%d,-\", PropInfo[propid][PropValue]); SendClientMessage(playerid, 0xFF0000AA, str); return 1;}new pName[MAX_PLAYER_NAME];GetPlayerName(playerid, pName, sizeof(pName));if(PropInfo[propid][PropIsBought] && PropInfo[propid][PropUnbuyableTime] == 0){ new ownerid = GetPlayerID(PropInfo[propid][PropOwner]); format(str, 128, \"%s megvásárolta a következõ ingatlant: \\\"%s\\\". Te ennyit keresel vele:($%d)\", pName, PropInfo[propid][PropName], (PropInfo[propid][PropValue]/2)); GivePlayerMoney(ownerid, (PropInfo[propid][PropValue]/2)); SendClientMessage(ownerid, 0xFFFF00AA, str); PlayerProps[ownerid]--;}PropInfo[propid][PropOwner] = pName;PropInfo[propid][PropIsBought] = 1;PropInfo[propid][PropUnbuyableTime] = UNBUYABLETIME;EarningsForPlayer[playerid] += PropInfo[propid][PropEarning]; GivePlayerMoney(playerid, (0-PropInfo[propid][PropValue]));format(str, 128, \"Megvásároltad a következõ ingatlant: \\\"%s\\\" ennyiért: $%d\", PropInfo[propid][PropName], PropInfo[propid][PropValue]); SendClientMessage(playerid, 0xFFFF00AA, str); format(str, 128, \"%s megvásárolta a következõ ingatlant: \\\"%s\\\" ennyiért: $%d.\", pName, PropInfo[propid][PropName], PropInfo[propid][PropValue]); SendClientMessageToAllEx(playerid, 0xFFFF00AA, str); PlayerProps[playerid]++; return 1; } return 0;}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ if(dialogid == 1 && response) //Helyetesítsd be az id-t return OnPlayerCommandText(playerid,\"/buy\"); return 0;}