Pawno-Properties

Technická podpora k herním serverům GTA San Andreas Multiplayer
Message
Autor
Neopry
Příspěvky: 160
Registrován: 18 bře 2012, 17:17
Reputation: 0

Pawno-Properties

#1 Příspěvekod Neopry » 23 črc 2013, 12:56

Ahoj,
Na serveru mám zařízená properties (Obchody, nemovitosti) Pickupy tam mám funguje mi jenom jeden z nich...
U ostatních tam jsou jenom ikony a když do nich vkročím tak nic...
Prosím poraďte co mám udělat aby šli všechny ?
Předem díky ;)

Properties:
Spoiler: zobrazit
#include <a_samp>
#include <Properties>

#define IsPlayerInSphere(%0,%1,%2,%3,%4) IsPlayerInRangeOfPoint(%0,%4,%1,%2,%3)
#define MAX_PROPERTIES 250

public OnFilterScriptInit()
{

print("----------------------------------------");
print(" Example Property Filterscript ");
print(" by =>Sandra<= ");
print("----------------------------------------");

UsePropertyTextDraw(0);
SetMaxPropertiesPerPlayer(1);
SetPayoutFrequency(86400);

CreatePickup(1274,1,1875.8311, 2071.6968, 10.5961);
CreatePickup(1274,1,2237.6631, 1282.0703, 10.8188);
CreatePickup(1274,1,2391.6279, 2042.5323, 10.3335);
CreatePickup(1274,1,2439.3154, 2064.6541, 10.5420);
CreatePickup(1274,1,2450.4277, 2064.8438, 10.2988);
CreatePickup(1274,1,2467.2815, 2032.3179, 10.7110);
CreatePickup(1274,1,2548.3994, 1972.1982, 10.5449);
CreatePickup(1274,1,2485.1580, 1529.4688, 10.2916);
CreatePickup(1274,1,2158.8975, 941.8718, 10.6968);

AddProperty("Burger King", 1875.8311, 2071.6968, 10.5961, 1500000, 1500000, 1000);
AddProperty("Las Venturas", 2237.6631, 1282.0703, 10.8188, 10000000, 10000000, 2200);
AddProperty("KFC", 2391.6279, 2042.5323, 10.3335, 15000000, 1500000, 1000);
AddProperty("Bird Bar", 2439.3154, 2064.6541, 10.5420, 1000000, 1000000, 900);
AddProperty("24-7", 2450.4277, 2064.8438, 10.2988, 10000000, 1000000, 9000);
AddProperty("Burger Food" ,2467.2815, 2032.3179, 10.7110, 1500000, 1500000, 1000);
AddProperty("24-7", 2548.3994, 1972.1982, 10.5449, 10000000, 1000000, 900);
AddProperty("Indiano Hotel", 2485.1580, 1529.4688, 10.2916, 2000000, 2000000, 1500);
AddProperty("Ammo Nation", 2158.8975, 941.8718, 10.6968, 1800000, 180000, 1200);
return 1;
}

public OnFilterScriptExit()
{
DestroyAllPropertyPickups();
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
ResetPlayerPropertyInfo(playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);

//===========================================================
if (strcmp("/propertyinfo", cmd, true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "Napis: /propertyinfo [PropertyID]");
return 1;
}
new prop = strval(tmp);
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
new Float:X, Float:Y, Float:Z;
new Price, Earning, SellValue, Name[64], Owner[MAX_PLAYER_NAME], Status[16];
GetPropertyInfo(prop, X, Y, Z, Price, SellValue, Earning);
format(Name, 64, "%s", GetPropertyName(prop));
format(Owner, MAX_PLAYER_NAME, "%s", GetPropertyOwner(prop));
format(Status, 16, "%s", GetPropertyStatus(prop));
new str[128];
format(str, 128, "Nazev: %s ** X: %.1f Y:%.1f ** Z:%.1f", Name, X, Y, Z);
SendClientMessage(playerid, 0xFFFFFFAA, str);
format(str, 128, "Cena: $%d ** Prodejni cena: $%d ** Zisk: $%d", Price, SellValue, Earning);
SendClientMessage(playerid, 0xFFFFFFAA, str);
format(str, 128, "Majitel: %s", Owner);
SendClientMessage(playerid, 0xFFFFFFAA, str);
format(str, 128, "Status: %s", Status);
SendClientMessage(playerid, 0xFFFFFFAA, str);
return 1;
}
//===========================================================
if (strcmp("/disableproperty", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
new prop = strval(tmp);
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
ToggleProperty(prop, 0);
return 1;
}
if (strcmp("/enableproperty", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
new prop = strval(tmp);
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
ToggleProperty(prop, 1);
return 1;
}
//===========================================================
if (strcmp("/myproperties", cmdtext,true) == 0)
{
GetPlayerProperties(playerid);
return 1;
}
//===========================================================
if (strcmp("/buyproperty", cmdtext, true) == 0)
{
BuyPropertyForPlayer(playerid);
return 1;
}
//===========================================================
if (strcmp("/sellproperty", cmdtext, true) == 0)
{
SellPropertyForPlayer(playerid);
return 1;
}
//===========================================================
if (strcmp("/locateproperty", cmd, true) == 0)
{
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE: /locateproperty [PropertyID]");
return 1;
}
new prop = strval(tmp);
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
LocatePropertyForPlayer(prop, playerid);
return 1;
}
//===========================================================
if (strcmp("/SetPropertyPrice", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "Napis: /SetPropertyPrice [PropertyID] [Price]");
return 1;
}
new prop = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "Napis: /SetPropertyPrice [PropertyID] [Price]");
return 1;
}
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
new str[128];
new price = strval(tmp);
SetPropertyPrice(prop, price);
format(str, 128, "You've set the price of \"%s\" (ID: %d) to $%d", PropInfo[prop][PropName], prop, price);
SendClientMessage(playerid, 0x00FF00AA, str);
return 1;
}
//===========================================================
if (strcmp("/SetPropertyValue", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE: /SetPropertyValue [PropertyID] [Value]");
return 1;
}
new prop = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE: /SetPropertyValue [PropertyID] [Value]");
return 1;
}
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
new str[128];
new value = strval(tmp);
SetPropertySellValue(prop, value);
format(str, 128, "You've set the value of \"%s\" (ID: %d) to $%d", PropInfo[prop][PropName], prop, value);
SendClientMessage(playerid, 0x00FF00AA, str);
return 1;
}
//===========================================================
if (strcmp("/SetPropertyEarning", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE: /SetPropertyEarning [PropertyID] [Earning]");
return 1;
}
new prop = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0xFF0000AA, "USAGE: /SetPropertyEarning [PropertyID] [Earning]");
return 1;
}
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
new str[128];
new earning = strval(tmp);
SetPropertyEarning(prop, earning);
format(str, 128, "You've set the earning of \"%s\" (ID: %d) to $%d", PropInfo[prop][PropName], prop, earning);
SendClientMessage(playerid, 0x00FF00AA, str);
return 1;
}

//===========================================================
if (strcmp("/disablecp", cmdtext, true) == 0)
{
DisablePlayerCheckpoint(playerid);
return 1;
}
//==========================================================
if (strcmp("/GetPropertyID", cmdtext, true) == 0)
{
new ID = IsPlayerNearProperty(playerid);
if(ID == -1) return SendClientMessage(playerid, 0xFF0000AA, "Jste prilis daleko od obchodu!");
new str[128];
format(str, 128, "You are now near property ID '%d': \"%s\"", ID, PropInfo[ID][PropName]);
SendClientMessage(playerid, 0x00FFFFAA, str);
return 1;
}
//===========================================================
if (strcmp("/SaveProperty", cmd, true) == 0)
{
if(!IsPlayerAdmin(playerid)) return 0;
new prop = IsPlayerNearProperty(playerid);
if(prop == -1) return SendClientMessage(playerid, 0xFF0000AA, "Nejste dost blizko u obchodu");
if(!DoesPropertyExists(prop)) return SendClientMessage(playerid, 0xFF0000AA, "Tento obchod neexistuje!");
SaveProperty(prop, cmdtext[13]);
SendClientMessage(playerid, 0x00FF00AA, "Property Saved!");
return 1;
}
//===========================================================
if (strcmp("/propertyhelp", cmdtext, true) == 0)
{
SendClientMessage(playerid, 0x0FFFFFFAA, "Property Commands:");
SendClientMessage(playerid, 0x0FFFFFFAA, "/buyproperty, /sellproperty, /myproperties, /getpropertyID");
SendClientMessage(playerid, 0x0FFFFFFAA, "/locateproperty [ID], /disableCP, /propertyinfo [ID]");
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, 0x0FFFFFFAA, "/SetPropertyPrice [ID] [Price]");
SendClientMessage(playerid, 0x0FFFFFFAA, "/SetPropertyValue [ID] [Value]");
SendClientMessage(playerid, 0x0FFFFFFAA, "/SetPropertyEarnin [ID] [Earning]");
SendClientMessage(playerid, 0x0FFFFFFAA, "/disableproperty [ID], /enableproperty [ID]");
SendClientMessage(playerid, 0x0FFFFFFAA, "/saveproperty [comment (optional)]");
}
return 1;
}
return 0;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
OnPropertyPickupPickup(playerid, pickupid);
return 1;
}

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

Zpět na „GTA San Andreas Multiplayer“

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 22 hostů