Making Checkpoint automatically
#1

Hello , is there any way to make auto checkpoint . I mean i want to set checkpoint in front of biz. So when i create a biz a checkpoint also create in some distance.I know it is impossible to do something without code i.e. my biz coding but tell me how to do . Give me idea.
Reply
#2

You want to create a checkpoint with your business?
Reply
#3

Yes , i want to create a checkpoint with my biz.
Reply
#4

show ur biz code
Reply
#5

PHP код:
COMMAND:createbiz(playeridparams[])
{
    
// If a player hasn't logged in properly, he cannot use this command
    
if (INT_IsPlayerLoggedIn(playerid) == 0) return 0;
    
// If the player has an insufficient admin-level (he needs level 5 or RCON admin), exit the command
    // returning "SERVER: Unknown command" to the player
    
if (INT_CheckPlayerAdminLevel(playerid5) == 0) return 0;
    
// Setup local variables
    
new HPriceMaxLevelbizID;
    
// Check if the player isn't inside a vehicle (the admin-player must be on foot to use this command)
    
if (GetPlayerVehicleSeat(playerid) == -1)
    {
        if (
sscanf(params"ii"HPriceMaxLevel)) SendClientMessage(playerid0xFFFFFFFF"{FF0000}Usage: \"/createbiz <price> <maxlevel (1-10)>\"");
        else
        {
            
// Check if the player entered a proper maxlevel
            
if ((MaxLevel >= 1) && (MaxLevel <= 10))
            {
                
// Find the first free bizID
                
for (bizID 1;bizID MAX_BIZESbizID++)
                    if (!
IsValidDynamicPickup(AbizData[bizID][PickupID])) // Check if an empty biz-index has been found (PickupID is 0)
                        
break; // Stop searching, the first free bizID has been found now
                // Check if the biz-limit hasn't been reached yet
                // This would seem to double-check the pickup-id, but in case there was no free bizslot found (bizID points
                // to the last index, the last index would hold a biz, so be sure to not overwrite it
                
if (!IsValidDynamicPickup(AbizData[bizID][PickupID]))
                {
                    
// Setup some local variables
                    
new Float:xFloat:yFloat:zMsg[128];
                    
// Get the player's position
                    
GetPlayerPos(playeridxyz);
                    
// Set some default data
                    
AbizData[bizID][Owned] = false;
                    
AbizData[bizID][Owner] = 0;
                    
AbizData[bizID][bizX] = x;
                    
AbizData[bizID][bizY] = y;
                    
AbizData[bizID][bizZ] = z;
                    
AbizData[bizID][bizLevel] = 1;
                    
AbizData[bizID][bizMaxLevel] = MaxLevel;
                    
AbizData[bizID][bizPrice] = HPrice;
                    
AbizData[bizID][bizOpened] = false;
                    
                    
                    
// Add the pickup and 3DText at the location of the biz-entrance (where the player is standing when he creates the biz)
                    
biz_UpdateEntrance(bizID);
                    
// Save the biz
                    
bizFile_Save(bizID);
                    
// Inform the player that he created a new biz
                    
format(Msg128"{00FF00}You've succesfully created a biz with ID: {FFFF00}%i"bizID);
                    
SendClientMessage(playerid0xFFFFFFFFMsg);
                }
                else
                    
SendClientMessage(playerid0xFFFFFFFF"{FF0000}The maximum amount of bizhas been reached");
            }
            else
                
SendClientMessage(playerid0xFFFFFFFF"{FF0000}You have to use a max-level from 1 to 10");
        }
    }
    else
        
SendClientMessage(playerid0xFFFFFFFF"{FF0000}You must be on foot to create a biz");
    
// Let the server know that this was a valid command
    
return 1;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)