10.12.2012, 14:09
Add this on top and down of the #include <a_samp>
then use this:
Код:
#if !defined isnull #define isnull(%1) \ ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1])))) #endif
pawn Код:
command(sethouseaddress, playerid, params[])
{
new string[128];
if(isnull(params))
{
if(Player[playerid][AdminLevel] >= 6)
{
SendClientMessage(playerid, WHITE, "SYNTAX: /sethouseaddress [address]");
}
}
else
{
if(Player[playerid][AdminLevel] >= 6)
{
for(new h = 0; h < MAX_HOUSES; h++)
{
if(strcmp(Houses[h][hAddress], address, true))
{
if(IsPlayerInRangeOfPoint(playerid, 2, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ]))
{
format(Houses[h][hAddress], 255, "%s", params);
format(string, sizeof(string), "You succesfully renamed house id: %d's address to: %s", h, params);
SCM(playerid, YELLOW, string);
SaveHouse(h);
break;
}
}
else
{
SCM(playerid, RED, "This address already exists");
}
}
}
}
return 1;
}

