House system problem ?
#2

This should do the job, but please, stop using these damn old methods, this could've be done way faster using the current plugins and includes out there to make it easier.
PHP код:
if(strcmp(cmd"/createhouse"true) == 0)
{
    if(
IsPlayerConnected(playerid))
    {
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /createhouse [type] [price] [level] [interior]");
            
SendClientMessage(playeridCOLOR_GRAD2"TYPE: (1) Small , Medium , Big");
            return 
1;
        }
        if(
PlayerInfo[playerid][pAdmin] < 3)
        {
            
SendClientMessage(playeridCOLOR_GRAD1"You don't have acces to use this command.");
            return 
1;
        }
        new 
type;
        new 
price;
        new 
level;
        new 
interior;
        
type strval(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /createhouse [type] [price] [level] [interior]");
            
SendClientMessage(playeridCOLOR_GRAD2"TYPE: (1) Small , Medium , Big");
            return 
1;
        }
        
price strval(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {

            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /createhouse [type] [price] [level] [interior]");
            
SendClientMessage(playeridCOLOR_GRAD2"TYPE: (1) Small , Medium , Big");
            return 
1;
        }
        
level strval(tmp);
        
tmp strtok(cmdtextidx);
        if(!
strlen(tmp))
        {
            
SendClientMessage(playeridCOLOR_GRAD2"USAGE: /createhouse [type] [price] [level] [interior]");
            
SendClientMessage(playeridCOLOR_GRAD2"TYPE: (1) Small , Medium , Big");
            return 
1;
        }
        
interior strval(tmp);
        
tmp strtok(cmdtextidx);
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        new 
hid sHouse 1;
        
HouseInfo[hid][hOwned] = 0;
        
HouseInfo[hid][hRent] = 0;
        
HouseInfo[hid][hLevel] = level;
        
HouseInfo[hid][hTakings] = 0;
        
format(HouseInfo[hid][hOwner], 128"No-One");
        
        if(
type == 1)
        {
            
printf("Type luat");
            if(
interior == 1)
            {
                
printf("Interior luat");
                
HouseInfo[hid][hType] = 1;
                
HouseInfo[hid][hInt] = 10;
                
HouseInfo[hid][hExitx] = 2259.38;
                
HouseInfo[hid][hExity] = -1135.77;
                
HouseInfo[hid][hExitz] = 1050.64;
                
HouseInfo[hid][hEntrancex] = x
                
HouseInfo[hid][hEntrancey] = y;
                
HouseInfo[hid][hEntrancez] = y;
            }
        }
        new 
fftext[20];
        if(
HouseInfo[hid][hType] == 1) { fftext "mic"; }
        
        
HouseInfo[hid][hPickup] = AddStaticPickup(127323HouseInfo[hid][hEntrancex],HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez]);
        
format(stringsizeof(string), "[ Casa de vanzare ]\n\n( Pret de cumparare %d$ )\n( Nivelul necesar %d )\n( Interiorul este %s )"HouseInfo[hid][hValue], HouseInfo[hid][hLevel], fftext);
        
HouseInfo[hid][hText3D] = CreateDynamic3DTextLabel(stringCOLOR_GROVEHouseInfo[hid][hEntrancex],HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez],10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1,0,-1,-145.0);
        
sHouse++;
        
printf(" Am creat casa %d"sHouse);
    }
    return 
1;

Reply


Messages In This Thread
House system problem ? - by Metharon - 10.06.2015, 14:43
Re: House system problem ? - by Jimmy0wns - 10.06.2015, 14:50
Re: House system problem ? - by CodeStyle175 - 10.06.2015, 15:12

Forum Jump:


Users browsing this thread: 1 Guest(s)