Simple problem
#1

hey guys is possible if i want to put 2-3 houses near to a gang HQ to pay more on every hour ? like a protection fee ? can some1 help me out with something?

like house with id: 100,101,102 to pay 100$ more at every bill
Reply
#2

Yea, show us your code where you generate the bills for them and the gang hq stuff.

This forum requires that you wait 120 seconds between posts. Please try again in 22 seconds. -_-
Reply
#3

If you add the include uf.inc, you can use some of the functions to help you.

PHP код:
#include <uf> // Don't forget to declare the include
//Make sure to change the variables accordingly, this is only a template.
//Place this in the function you use to generate bills.
for(new 0MAX_GANGSi++) // Creates for loop to see any gang is nearby.
{
    if(
IsHouseInRangeOfGang(HouseInfo[i], 30.0// Get the HouseID you want checked if it is in range of any gangs.
    
{
        new 
string[64]; // Create a string to store the message being sent to the player.
        
HouseInfo[i][hTax] += 100// Sets the house's tax to be $100.00 more than it should because a gang is in the area.
        
format(stringsizeof(string), "You have paid an extra $100 to %s as a protection fee."GetNearbyGangName(hID30.0); // Formats string to notify player it paid a protection fee to said gang.
        
SendClientMessage(playeridCOLOR_LIGHTREDstring); // Sends the formatting string.
    
}
}
//Now we have to create the functions we just used.
public IsHouseInRangeOfGang(hIDFloat:range// Create IsHouseInRangeOfGang.
{
    for(new 
0MAX_GANGSi++) // Create loop so it will search to see if any gang is within range.
    
{
        new 
Float:gRange GetPointDistanceToPointEx(HouseInfo[hID][hPosX], HouseInfo[hID][hPosY], HouseInfo[hID][hPosZ], GangInfo[i][gPosX], GangInfo[i][gPosY], GangInfo[i][gPosZ]);
        if(
gRange range// Calculates range then compares to see if within specified range.
            
return 1// Tells the script that there is a nearby gang.
    
}
    return 
0// Lets the script know there was no nearby gangs in the area.
}
forward IsHouseInRangeOfGang(hIDFloat:range);
stock GetNearbyGangName(hIDFloat:range// Create GetNearbyGangName - It's a stock because it's returning a string.
{
    new 
gangName[32], Float:gRange;
    for(new 
0MAX_GANGSi++) // Create loop like InHouseInRangeOfGang except returns gang name instead of 1 or 0.
    
{
        
gRange GetPointDistanceToPointEx(HouseInfo[hID][hPosX], HouseInfo[houseID][hPosY], HouseInfo[houseID][pPosZ], GangInfo[i][gPosX], GangInfo[i][gPosY], GangInfo[i][gPosZ]);
        if(
gRange range// Calculates range then compares to see if within the specified range.
            
gangName GangInfo[i][gName]; // Sets variable to gang's name
    
}
    return 
gangName// Returns the gangs name to where the stock was called.

Reply
#4

thx verry much it works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)