House Icon - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: House Icon (
/showthread.php?tid=616155)
House Icon -
Hunud - 01.09.2016
Hey Guys,
How to make on this command when i create house icon will display on map "green house" +REP if helped
Код:
COMMAND:napravikucu(playerid, params[])
{
// Setup local variables
new HPrice, MaxLevel, HouseID;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/napravikucu", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if (APlayerData[playerid][PlayerLevel] >= 9)
{
// Check if the player isn't inside a vehicle
if (GetPlayerVehicleSeat(playerid) == -1)
{
if (sscanf(params, "ii", HPrice, MaxLevel)) SendClientMessage(playerid, 0xFF0000AA, "Komanda: \"/Napravikucu <cijena> <maxlevel (1-10)>\"");
else
{
// Check if the player entered a proper maxlevel
if ((MaxLevel >= 1) && (MaxLevel <= 10))
{
// Find the first free HouseID
for (HouseID = 1; HouseID < MAX_HOUSES; HouseID++)
if (AHouseData[HouseID][PickupID] == 0) // Check if an empty house-index has been found (PickupID is 0)
break; // Stop searching, the first free HouseID has been found now
// Check if the house-limit hasn't been reached yet
if (HouseID < MAX_HOUSES)
{
// Setup some local variables
new Float:x, Float:y, Float:z, Msg[128];
// Get the player's position
GetPlayerPos(playerid, x, y, z);
// Set some default data
AHouseData[HouseID][HouseX] = x;
AHouseData[HouseID][HouseY] = y;
AHouseData[HouseID][HouseZ] = z;
AHouseData[HouseID][HouseLevel] = 1;
AHouseData[HouseID][HouseMaxLevel] = MaxLevel;
AHouseData[HouseID][HousePrice] = HPrice;
AHouseData[HouseID][Owned] = false;
// Add the pickup and 3DText at the location of the house-entrance (where the player is standing when he creates the house)
House_CreateEntrance(HouseID);
// Save the house
HouseFile_Save(HouseID);
// Inform the player that he created a new house
format(Msg, 128, "{00FF00}Napravio si kucu (ID:{FF00FF}%i{00FF00})", HouseID);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
else
SendClientMessage(playerid, 0xFF0000FF, "Maximalan broj kuca je napravljen");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Koristi Max level 1 do 10");
}
}
else
SendClientMessage(playerid, 0xFF0000FF, "Napusti vozilo da bi kreirao kucu");
}
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: House Icon -
FreAkeD - 01.09.2016
https://sampwiki.blast.hk/wiki/SetPlayerMapIcon
https://sampwiki.blast.hk/wiki/MapIcons
SetPlayerMapIcon(playerid, id, x, y, z, 31, 0, MAPICON_LOCAL);
Re: House Icon -
Hunud - 01.09.2016
How put that in code im newbie!
Re: House Icon -
Mister0 - 01.09.2016
Quote:
Originally Posted by Hunud
How put that in code im newbie!
|
Search with ctrl+f ongamemodeinit and there put the code
SetPlayerMapIcon(playerid, id, x, y, z, 31, 0, MAPICON_LOCAL);
Re: House Icon -
Hunud - 01.09.2016
It must be inside code! check above
Re: House Icon -
Hunud - 01.09.2016
BUMP! please help