19.06.2012, 22:22
(
Последний раз редактировалось CrazyChoco; 21.06.2012 в 15:15.
)
Hai, im trying to make an code into zcmd but when i do ill get this ingame even if i fill it corret out here is my code:
when i type ex. telehouse 5 ill recive this
Usage: /Telehouse [houseid]
pawn Код:
CMD:addhouse(playerid, params, cmdtext[])//Admin CMD //bug
{
new string[256];
new cmd[256];
new giveplayerid, idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
new Float:x, Float:y, Float:z, Float:r, price, interior, id, msg[128];
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, r);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)){
ERROR("Usage: /AddHouse [price] (interior=0)");
return 1;
}
price = strval(tmp);
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)){
ERROR("Usage: /AddHouse [price] (interior=0)");
return 1;
}
interior = strval(tmp);
if ((id = CreateHouse(x, y, z, r, price, interior)) == INVALID_HOUSE_ID) ERROR("House could not be created! House limit "#MAX_HOUSES" may have been reached");
format(MSG, "House %d has been created with price %s and interior %d", id, FormatMoney(Houses[id][house_price]), Houses[id][house_interior]);
MESSAGE(msg);
Streamer_Update(playerid);
return 1;
}
CMD:telehouse(playerid, params, cmdtext[])//some kind of bug
{
new string[256];
new cmd[256];
new giveplayerid, idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
new Float:x, Float:y, Float:z, id;
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return ERROR("Usage: /Telehouse [houseid]");
id = strval(tmp);
if (!GetHousePos(id, x, y, z)) return ERROR("Invalid house id!");
SetPlayerPos(playerid, x, y ,z);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, x, y, z);
return 1;
}
Usage: /Telehouse [houseid]