08.11.2010, 15:36
Make it Dynamic (In other words, make administrators able to create sell-able houses instead of doing that in scriptfiles which a little bit takes ages.)
I know the script, and you forget some functions
First 1. The split. 2. The mapicon include |
Originally Posted by Kwarde
There where some functions, that aren't builded in SA:MP standard, so they are here: http://www.rpdsamp.nl/other/sampforu...ousesystem.txt
|
Haha i'm sorry, i thought it + i didnt download it because i don't like .cfg :P MySQL FTW
|
dcmd_sellhouse(playerid, params[])
{
#pragma unused params
for(new h = 0; h < MAX_HOUSES; h++)
{
if(IsPlayerInRangeOfPoint(playerid, 2, HouseInfo[h][hEntrancePosX], HouseInfo[h][hEntrancePosY], HouseInfo[h][hEntrancePosZ]))
{
new pName[MAX_PLAYER_NAME],string[128];GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
if(!strcmp(HouseInfo[h][hOwner], pName, false) && HouseInfo[h][hOwned] == 1) //You have to be the owner of the house ;) (the only problem is, if you are using someone elses name, you can sell it too, but you can integrate this script with another script of course ;)
{
HouseInfo[h][hOwned] = 0;
strdel(HouseInfo[h][hOwner], 0, strlen(HouseInfo[h][hOwner]));
GivePlayerMoney(playerid, (HouseInfo[h][hPrice]/2)); //Let's return the half of the price
DestroyMapIcon(HOUSE_ICON[h]); DestroyPickup(HOUSE_PICKUP[h]);
HOUSE_ICON[h] = CreateMapIcon(31, 0, HouseInfo[h][hEntrancePosX], HouseInfo[h][hEntrancePosY], HouseInfo[h][hEntrancePosZ]);
HOUSE_PICKUP[h] = CreatePickup(1272, 1, HouseInfo[h][hEntrancePosX], HouseInfo[h][hEntrancePosY], HouseInfo[h][hEntrancePosZ]);
format(string, sizeof(string), "** %s has selled a house", pName);
SendClientMessageToAll(0x00FF00AA, string);
SaveAllHouses();
return 1;
}
else return SendClientMessage(playerid, 0xFF0000AA, "** You can only sell your own houses ;)");
}
}
return 1;
}
It looks really similar to TheKiller's system...
https://sampforum.blast.hk/showthread.php?tid=118379 |
SaveHouse(playerid);
LoadHouseVisual(playerid, true);
cgrp.pwn(589) : error 017: undefined symbol "DestroyDynamicPickup"
cgrp.pwn(593) : error 017: undefined symbol "CreateDynamicPickup"
cgrp.pwn(597) : error 017: undefined symbol "CreateDynamicPickup"
cgrp.pwn(605) : error 017: undefined symbol "ini_FloatSet"
cgrp.pwn(606) : error 017: undefined symbol "ini_FloatSet"
cgrp.pwn(607) : error 017: undefined symbol "ini_FloatSet"
cgrp.pwn(608) : error 017: undefined symbol "ini_FloatSet"
cgrp.pwn(609) : error 017: undefined symbol "ini_FloatSet"
cgrp.pwn(610) : error 017: undefined symbol "ini_FloatSet"
cgrp.pwn(611) : error 017: undefined symbol "ini_IntSet"
cgrp.pwn(612) : error 017: undefined symbol "ini_IntSet"
cgrp.pwn(613) : error 017: undefined symbol "ini_IntSet"
cgrp.pwn(614) : error 017: undefined symbol "ini_IntSet"
cgrp.pwn(615) : error 017: undefined symbol "ini_BoolSet"
cgrp.pwn(616) : error 017: undefined symbol "ini_Get"
cgrp.pwn(617) : error 017: undefined symbol "ini_IntSet"