05.02.2016, 11:27
Hello, I've scripted a command to buy a house, I made it currently to send you a message contains the id of the house checkpoint that you are in, but if I use the command while not in a checkpoint, it spams sending me message"word_system"0.... tons of times.
EDITED
Код:
CMD:h(playerid, params[])
{
new selection[10];
if(sscanf(params, "s[20]", selection)) return SendUsageMSG(playerid, "/h [BUY/SELL/CONFIG]");
if(!strcmp(selection, "buy", true))
{
for(new i = 0; i < MAX_HOUSES; i++)
{
if(IsPlayerInDynamicCP(playerid, hInfo[i][EntranceCP]))
{
if(hInfo[i][hOwned] == 0)
{
new string[128];
format(string, sizeof(string), ""WORD_SYSTEM"%d", hInfo[i][hID]);
SCM(playerid, COLOR_WHITE, string);
SetHouseOwner(i, PlayerName(playerid));
}
}
}
}
return 1;
}



+REP'd