Command partly isn't working
#10

Replace your command with the one below, try it in-game and you'll receive a message in white.
If the value next to "tmp" is higher than the value next to "max_houses", find "#define MAX_HOUSES" in your script and change the value of it to something higher than the one next to "tmp".
pawn Код:
CMD:createhouse(playerid,params[])
{
    new str[128];
    format(str,sizeof(str),"tmp: %i -- max_houses: %i", HouseCount, MAX_HOUSES);
    SendClientMessage(playerid, 0xFFFFFFFF, str);
    new HousePrice, tmp=HouseCount;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"Tu negali naudot sitos komandos,lops");
    if(sscanf(params,"d",HousePrice)) return SendClientMessage(playerid,0xFF0000FF,"Naudojimas /createhouse [Namo Kaina]");
    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;
}
Reply


Messages In This Thread
Command partly isn't working - by dusk - 02.03.2013, 12:06
Re: Command partly isn't working - by Djole1337 - 02.03.2013, 12:29
Re: Command partly isn't working - by dusk - 02.03.2013, 14:07
Re: Command partly isn't working - by dusk - 02.03.2013, 15:37
Re: Command partly isn't working - by Catalyst- - 02.03.2013, 15:49
Re: Command partly isn't working - by dusk - 02.03.2013, 15:57
Re: Command partly isn't working - by dusk - 02.03.2013, 18:30
Re: Command partly isn't working - by Ruben_Alonso - 02.03.2013, 18:47
Re: Command partly isn't working - by dusk - 02.03.2013, 18:53
Re: Command partly isn't working - by Catalyst- - 02.03.2013, 19:13

Forum Jump:


Users browsing this thread: 1 Guest(s)