02.03.2013, 12:06
I was creating a house system. So this command should create a house:
But the thing is, if I use /createhouse, it works,it sends the text.But if I use it correctly, /creathouse 1000, I get: Server:Unknown command. Like wtf?
pawn Код:
CMD:createhouse(playerid,params[])
{
new HousePrice,tmp=HouseCount;
if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid,0xFF0000FF,"Tu negali naudot sitos komandos,lops");
else if(sscanf(params,"d",HousePrice)) SendClientMessage(playerid,0xFF0000FF,"Naudojimas /createhouse [Namo Kaina]");
else
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
HouseInfo[tmp][Price]=HousePrice;
HouseInfo[tmp][Owned]=0;
HouseInfo[tmp][PosX]=x;
HouseInfo[tmp][PosY]=y;
HouseInfo[tmp][PosZ]=z;
HouseInfo[tmp][VirtualWorld] = GetPlayerVirtualWorld(playerid);
HouseEnter[tmp]=CreateDynamicCP(x,y,z,1.5,GetPlayerVirtualWorld(playerid));
format(HouseInfo[tmp][Owner],24,"None");
HouseExit[tmp]=CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,GetPlayerVirtualWorld(playerid));
new query[128],labelstring[126];
format(query,sizeof(query),"INSERT INTO houses (Owner,Owned,VirtualWorld,PosX,PosY,PosZ,Price) VALUES ('%s',0,%d,%f,%f,%f,%s)",HouseInfo[tmp][Owner],GetPlayerVirtualWorld(playerid),x,y,z,HousePrice);
mysql_query(query);
format(labelstring,sizeof(labelstring),"Namas Parduodamas \n Kaina:%d \nNoredamas pirkti rasyk /buyhouse",HousePrice);
HouseInfo[tmp][HouseLabel] = Create3DTextLabel(labelstring,0x00FF00FF,x,y,z,25,GetPlayerVirtualWorld(playerid),0);
HouseCount++;
}
return 1;
}