Create businesses help
#1

Good afternoon,

I have a little probem with the create businesses command, It's a long time ago that i was scripting.

But this is my problem,

If i use the command everything works, Till it creates, The pickup and the save is created but it doens't show up the textdraw and he doesn't see the ID from the businesses, So if you guys can help me

PHP код:
command(createbusinessplayeridparams[])
{
    new 
Usage[128], string[128];
    if(
sscanf(params"z"Usage))
    {
        if(
AdminLoggedIn[playerid] == && Player[playerid][Adminlevel] >= 6)
        {
            
SendClientMessage(playeridWHITE"SYNTAX: /createbusiness [usage]");
            
SendClientMessage(playeridGREY"Usage: Interior, Exterior, Shop or Complete.");
        }else 
ErrorPTD(playerid,1,"You cannot use this command!");
    }
    else
    {
        if(
AdminLoggedIn[playerid] == && Player[playerid][Adminlevel] >= 6)
        {
            if(
strcmp(Usage"exterior"true) == 0)
            {
                
Player[playerid][BizExterior]++;
                
Player[playerid][bExtID] = GetPlayerInterior(playerid);
                
GetPlayerFacingAngle(playeridPlayer[playerid][bExtA]);
                
GetPlayerPos(playeridPlayer[playerid][bExtX], Player[playerid][bExtY], Player[playerid][bExtZ]);
                
format(stringsizeof(string), "Exterior set! (X: %f, Y: %f, Z: %f)."Player[playerid][bExtX], Player[playerid][bExtY], Player[playerid][bExtZ]);
                
SendClientMessage(playeridWHITEstring);
               }
            if(
strcmp(Usage"interior"true) == 0)
            {
                
Player[playerid][BizInterior]++;
                
Player[playerid][bIntID] = GetPlayerInterior(playerid);
                
GetPlayerFacingAngle(playeridPlayer[playerid][bIntA]);
                
GetPlayerPos(playeridPlayer[playerid][bIntX], Player[playerid][bIntY], Player[playerid][bIntZ]);
                
format(stringsizeof(string), "Interior set! (X: %f, Y: %f, Z: %f)."Player[playerid][bIntX], Player[playerid][bIntY], Player[playerid][bIntZ]);
                
SendClientMessage(playeridWHITEstring);
            }
            if(
strcmp(Usage"shop"true) == 0)
            {
                
Player[playerid][BizShop]++;
                
Player[playerid][bShoID] = GetPlayerInterior(playerid);
                
GetPlayerPos(playeridPlayer[playerid][bShoX], Player[playerid][bShoY], Player[playerid][bShoZ]);
                
format(stringsizeof(string), "Spawn possition set! (X: %f, Y: %f, Z: %f)."Player[playerid][bShoX], Player[playerid][bShoY], Player[playerid][bShoZ]);
                
SendClientMessage(playeridWHITEstring);
            }
            if(
strcmp(Usage"complete"true) == 0)
            {
                if(
Player[playerid][BizInterior] > || Player[playerid][BizExterior] > 0)
                {
                    new 
NewHouseID SpawnedBusinesses+1;
                    if(
NewHouseID >= MAX_BUSINESSES)
                    {
                        
SendClientMessage(playeridRED"> Too many businesses are currently spawned!");
                    }
                    else
                    {
                                
format(Businesses[NewHouseID][bName], 255"None");
                                
format(Businesses[NewHouseID][bOwner], 255"Nobody");
                                
format(Businesses[NewHouseID][bAddress], 255"None");
                                
Businesses[NewHouseID][bInteriorID] = Player[playerid][bIntID];
                                
Businesses[NewHouseID][bExteriorID] = Player[playerid][bExtID];
                                
Businesses[NewHouseID][bShopID] = Player[playerid][bShoID];
                                
Businesses[NewHouseID][bInteriorX] = Player[playerid][bIntX];
                                
Businesses[NewHouseID][bInteriorY] = Player[playerid][bIntY];
                                
Businesses[NewHouseID][bInteriorZ] = Player[playerid][bIntZ];
                                
Businesses[NewHouseID][bInteriorA] = Player[playerid][bIntA];
                                
Businesses[NewHouseID][bExteriorX] = Player[playerid][bExtX];
                                
Businesses[NewHouseID][bExteriorY] = Player[playerid][bExtY];
                                
Businesses[NewHouseID][bExteriorZ] = Player[playerid][bExtZ];
                                
Businesses[NewHouseID][bExteriorA] = Player[playerid][bExtA];
                                
Businesses[NewHouseID][bShopX] = Player[playerid][bShoX];
                                
Businesses[NewHouseID][bShopY] = Player[playerid][bShoY];
                                
Businesses[NewHouseID][bShopZ] = Player[playerid][bShoZ];
                                
Businesses[NewHouseID][bSupplies] = 1000;
                                
Player[playerid][BizExterior]--;
                                 
Player[playerid][BizInterior]--;
                                 
Player[playerid][BizShop]--;
                                
SendClientMessage(playeridGREEN"> Successfully created business, don't forget to /setbusiness!");
                                
SetPlayerInterior(playeridBusinesses[NewHouseID][bExteriorID]);
                                
SetPlayerVirtualWorld(playerid0);
                                
SetPlayerPos(playeridBusinesses[NewHouseID][bExteriorX], Businesses[NewHouseID][bExteriorY], Businesses[NewHouseID][bExteriorZ]);
                                  
Businesses[NewHouseID][bLockStatus] = 1;
                                  
Businesses[NewHouseID][bPickupID] = CreateDynamicPickup(127223Businesses[NewHouseID][bExteriorX], Businesses[NewHouseID][bExteriorY], Businesses[NewHouseID][bExteriorZ], 0);
                                new 
query[2000];
                                 
format(querysizeof(query), "INSERT INTO `businesses` (`bInteriorID`, `bInteriorX`, `bInteriorY`, `bInteriorZ`, `bInteriorA`, `bExteriorID`, `bExteriorX`, `bExteriorY`, `bExteriorZ`, `bExteriorA`,");
                                
format(querysizeof(query), "%s `bShopID`, `bShopX`, `bShopY`, `bShopZ`, `bSupplies`) VALUES "query);
                                
format(querysizeof(query), "%s(%d, '%f', '%f', '%f', '%f', %d, '%f', '%f', '%f', '%f', %d, '%f', '%f', '%f', %d)",
                                
query,
                                
Player[playerid][bIntID],
                                 
Player[playerid][bIntX],
                                
Player[playerid][bIntY],
                                
Player[playerid][bIntZ],
                                
Player[playerid][bIntA],
                                 
Player[playerid][bExtID],
                                 
Player[playerid][bExtX],
                                
Player[playerid][bExtY],
                                
Player[playerid][bExtZ],
                                
Player[playerid][bExtA],
                                
Player[playerid][bShoID],
                                 
Player[playerid][bShoX],
                                
Player[playerid][bShoY],
                                
Player[playerid][bShoZ],
                                
Businesses[NewHouseID][bSupplies]);
                                  
SpawnedBusinesses++;
                                  
mysql_query(query);
                    }
                }
                else
                {
                    
SendClientMessage(playeridWHITE"> You must select an exterior and an interior first!");
                }
            }
        }else 
ErrorPTD(playerid,1,"You cannot use this command!");
    }
    return 
1;

R.I.P english
Reply
#2

I don't see where you try to show the textdraw.
Reply
#3

PHP код:
            else if(!strcmp(string"Business")){
                if(
strcmp(Businesses[Player[playerid][LastBiz]][bOwner], "Nobody"true) == 0)
                {
                    if(
Businesses[Player[playerid][LastBiz]][bPrice] == -1)
                    {
                        
PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                        
PlayerTextDrawShow(playerid,PropertyBusinessText[playerid]);
                        
PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],"Unavailable");
                        
PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);
                        
PTD[playerid][tProperty] = 2;
                    }
                    else
                    {
                        
PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                        
PlayerTextDrawShow(playerid,PropertyBusinessText[playerid]);
                        
format(string1sizeof(string1), "%s"Businesses[Player[playerid][LastBiz]][bName]);
                        
PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],string1);
                        
PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);
                        
                        
format(string1sizeof(string1), "~y~Address~n~~w~%s"Businesses[Player[playerid][LastBiz]][bAddress]);
                        
PlayerTextDrawSetString(playerid,PropertyFirstLineText[playerid],string1);
                        
format(string1sizeof(string1), "~y~Price~n~~w~$%d"Businesses[Player[playerid][LastBiz]][bPrice]);
                        
PlayerTextDrawSetString(playerid,PropertySecondLineText[playerid],string1);
                        
PlayerTextDrawShow(playerid,PropertyFirstLineText[playerid]);
                        
PlayerTextDrawShow(playerid,PropertySecondLineText[playerid]);
                        
PlayerTextDrawSetString(playerid,PropertyDoorText[playerid],"~w~CMD: ~r~/buybiz");
                        
PlayerTextDrawShow(playerid,PropertyDoorText[playerid]);
                        
PTD[playerid][tProperty] = 2;
                    }
                }
                else
                {
                    
PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                    
PlayerTextDrawShow(playerid,PropertyInfoText[playerid]);
                    
format(string1sizeof(string1), "%s"Businesses[Player[playerid][LastBiz]][bName]);
                    
PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],string1);
                    
PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);
                    
format(string1sizeof(string1), "~y~Address~n~~w~%s"Businesses[Player[playerid][LastBiz]][bAddress]);
                    
PlayerTextDrawSetString(playerid,PropertyFirstLineText[playerid],string1);
                    
format(string1sizeof(string1), "~y~Owner~n~~w~%s"Businesses[Player[playerid][LastBiz]][bOwner]);
                    
PlayerTextDrawSetString(playerid,PropertySecondLineText[playerid],string1);
                    
PlayerTextDrawShow(playerid,PropertyFirstLineText[playerid]);
                    
PlayerTextDrawShow(playerid,PropertySecondLineText[playerid]);
                    
PlayerTextDrawShow(playerid,PropertyDoorText[playerid]);
                    
PTD[playerid][tProperty] = 2;
                }
            }
        }
    } 
Reply
#4

pawn Код:
else if(!strcmp(string, "Business")){
                if(strcmp(Businesses[Player[playerid][LastBiz]][bOwner], "Nobody", true) == 0)
                {
                    print("Works 1");
                    if(Businesses[Player[playerid][LastBiz]][bPrice] == -1)
                    {
                        print("Works 2");
                        PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                        PlayerTextDrawShow(playerid,PropertyBusinessText[playerid]);
                        PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],"Unavailable");
                        PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);
                        PTD[playerid][tProperty] = 2;
                    }
                    else
                    {
                        print("Works 3");
                        PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                        PlayerTextDrawShow(playerid,PropertyBusinessText[playerid]);
                        format(string1, sizeof(string1), "%s", Businesses[Player[playerid][LastBiz]][bName]);
                        PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],string1);
                        PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);

                        format(string1, sizeof(string1), "~y~Address~n~~w~%s", Businesses[Player[playerid][LastBiz]][bAddress]);
                        PlayerTextDrawSetString(playerid,PropertyFirstLineText[playerid],string1);
                        format(string1, sizeof(string1), "~y~Price~n~~w~$%d", Businesses[Player[playerid][LastBiz]][bPrice]);
                        PlayerTextDrawSetString(playerid,PropertySecondLineText[playerid],string1);
                        PlayerTextDrawShow(playerid,PropertyFirstLineText[playerid]);
                        PlayerTextDrawShow(playerid,PropertySecondLineText[playerid]);
                        PlayerTextDrawSetString(playerid,PropertyDoorText[playerid],"~w~CMD: ~r~/buybiz");
                        PlayerTextDrawShow(playerid,PropertyDoorText[playerid]);
                        PTD[playerid][tProperty] = 2;
                    }
                }
                else
                {
                    print("Works 4");
                    PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                    PlayerTextDrawShow(playerid,PropertyInfoText[playerid]);
                    format(string1, sizeof(string1), "%s", Businesses[Player[playerid][LastBiz]][bName]);
                    PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],string1);
                    PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);

                    format(string1, sizeof(string1), "~y~Address~n~~w~%s", Businesses[Player[playerid][LastBiz]][bAddress]);
                    PlayerTextDrawSetString(playerid,PropertyFirstLineText[playerid],string1);
                    format(string1, sizeof(string1), "~y~Owner~n~~w~%s", Businesses[Player[playerid][LastBiz]][bOwner]);
                    PlayerTextDrawSetString(playerid,PropertySecondLineText[playerid],string1);
                    PlayerTextDrawShow(playerid,PropertyFirstLineText[playerid]);
                    PlayerTextDrawShow(playerid,PropertySecondLineText[playerid]);
                    PlayerTextDrawShow(playerid,PropertyDoorText[playerid]);
                    PTD[playerid][tProperty] = 2;
                }
            }
        }
    }
Go into the server, do what you do to test if it works and then check the server log file (server_log.txt).
Reply
#5

Quote:
Originally Posted by Unte99
Посмотреть сообщение
pawn Код:
else if(!strcmp(string, "Business")){
                if(strcmp(Businesses[Player[playerid][LastBiz]][bOwner], "Nobody", true) == 0)
                {
                    print("Works 1");
                    if(Businesses[Player[playerid][LastBiz]][bPrice] == -1)
                    {
                        print("Works 2");
                        PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                        PlayerTextDrawShow(playerid,PropertyBusinessText[playerid]);
                        PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],"Unavailable");
                        PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);
                        PTD[playerid][tProperty] = 2;
                    }
                    else
                    {
                        print("Works 3");
                        PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                        PlayerTextDrawShow(playerid,PropertyBusinessText[playerid]);
                        format(string1, sizeof(string1), "%s", Businesses[Player[playerid][LastBiz]][bName]);
                        PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],string1);
                        PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);

                        format(string1, sizeof(string1), "~y~Address~n~~w~%s", Businesses[Player[playerid][LastBiz]][bAddress]);
                        PlayerTextDrawSetString(playerid,PropertyFirstLineText[playerid],string1);
                        format(string1, sizeof(string1), "~y~Price~n~~w~$%d", Businesses[Player[playerid][LastBiz]][bPrice]);
                        PlayerTextDrawSetString(playerid,PropertySecondLineText[playerid],string1);
                        PlayerTextDrawShow(playerid,PropertyFirstLineText[playerid]);
                        PlayerTextDrawShow(playerid,PropertySecondLineText[playerid]);
                        PlayerTextDrawSetString(playerid,PropertyDoorText[playerid],"~w~CMD: ~r~/buybiz");
                        PlayerTextDrawShow(playerid,PropertyDoorText[playerid]);
                        PTD[playerid][tProperty] = 2;
                    }
                }
                else
                {
                    print("Works 4");
                    PlayerTextDrawShow(playerid,PropertyBGText[playerid]);
                    PlayerTextDrawShow(playerid,PropertyInfoText[playerid]);
                    format(string1, sizeof(string1), "%s", Businesses[Player[playerid][LastBiz]][bName]);
                    PlayerTextDrawSetString(playerid,PropertyTypeText[playerid],string1);
                    PlayerTextDrawShow(playerid,PropertyTypeText[playerid]);

                    format(string1, sizeof(string1), "~y~Address~n~~w~%s", Businesses[Player[playerid][LastBiz]][bAddress]);
                    PlayerTextDrawSetString(playerid,PropertyFirstLineText[playerid],string1);
                    format(string1, sizeof(string1), "~y~Owner~n~~w~%s", Businesses[Player[playerid][LastBiz]][bOwner]);
                    PlayerTextDrawSetString(playerid,PropertySecondLineText[playerid],string1);
                    PlayerTextDrawShow(playerid,PropertyFirstLineText[playerid]);
                    PlayerTextDrawShow(playerid,PropertySecondLineText[playerid]);
                    PlayerTextDrawShow(playerid,PropertyDoorText[playerid]);
                    PTD[playerid][tProperty] = 2;
                }
            }
        }
    }
Go into the server, do what you do to test if it works and then check the server log file (server_log.txt).
The textdraw doens't load, can you help me out?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)