25.05.2010, 21:23
Hello,
I got this command but when it's typed in the server the unknown command comes up.
I got this command but when it's typed in the server the unknown command comes up.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new tmp[500];
new idx;
new string[500];
// new sendername[MAX_PLAYER_NAME];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/createhouse", true) == 0)
{
if (AccountData[playerid][Admin] >= 4)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createhouse [id] [price]");
return 1;
}
new id = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[CMDINFO] - /createhouse [id] [price]");
return 1;
}
new price = strval(tmp);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
HouseInfo[id][hEnterX] = x;
HouseInfo[id][hEnterY] = y;
HouseInfo[id][hEnterZ] = z;
HouseInfo[id][EnterWorld] = GetPlayerVirtualWorld(playerid);
HouseInfo[id][EnterInterior] = GetPlayerInterior(playerid);
HouseInfo[id][hPrice] = price;
HouseInfo[id][hOwned] = 0;
HouseInfo[id][hRentable] = 0;
SaveHouses();
format(string, sizeof(string), "[House for sale]\nPrice: %d", HouseInfo[id][hPrice]);
Move3DTextLabel(housetext[id], string, COLOR_SPRINGGREEN, x, y, z);
SendClientMessage(playerid, COLOR_SPRINGGREEN, "House Created at Location");
return 1;
}
else SendClientMessage(playerid,RED,"Your Admin Level is wrong!");
}
return 1;
}