Property Renting Help
#1

i have this /rentprop command this is for only 1 person only 1 person can rent that peroperty
but i want that /rentprop can rent 5 persons at a time
help me please
PHP код:
CMD:rentprop(playeridparams[])
{
    new 
playername[25], giveplayeridgiveplayer[25], tmp[1080], string[256], moneys1,strings[40];
    if (
areatype[playerarea[playerid]][0] != AREA_TYPE_PROP) return SendClientMessage2(playeridCOLOR_RED"Error: You must be at a property to rent it!");
    
GetPlayerName(playeridplayernameMAX_PLAYER_NAME);
    
giveplayerid dini_Int(AddDirFile(dir_userfilesplayername), "propowned");
    if (
giveplayerid != 0)
    {
        if (
areatype[playerarea[playerid]][1] == giveplayerid) return SendClientMessage2(playeridCOLOR_YELLOW"You already own this property.");
    }
    
giveplayerid dini_Int(AddDirFile(dir_userfilesplayername), "proprented");
    if (
giveplayerid != 0)
    {
        if (
areatype[playerarea[playerid]][1] == giveplayeridSendClientMessage2(playeridCOLOR_YELLOW"You are already an tenant in this property.");
        return 
1;
    }
    
format(giveplayer10"prop%d"areatype[playerarea[playerid]][1]);
    
tmp dini_Get(AddDirFile(dir_propfilesgiveplayer), "renter");
    if (
strcmp(tmp"None"false) != 0) return SendPlayerFormattedText(playeridCOLOR_RED"This property is already rented by %s and cannot be rented!"tmp"");
    
moneys1 dini_Int(AddDirFile(dir_propfilesgiveplayer), "rentcost");
    if(
moneys1 == 0) return SendClientMessage(playeridCOLOR_RED"This property isnt set Let-To-Go.");
    if (
GetPlayerCash(playerid) < moneys1)
    {
        
format(string128"You don't have $%d and cannot rent this property!"moneys1);
        
SendClientMessage2(playeridCOLOR_REDstring);
        return 
1;
    }
    if (
playerZone[playerid] > sizeof(zonenames)-11)
    {
            
format(strings,sizeof(strings),"%s.",zonenames[playerZone[playerid]][z_name]);
    }
    else
    {
            
format(strings,sizeof(strings),"%s, %s. ",zonenames[playerZone[playerid]][z_name], zonenames[sizeof(zonenames)-(zonetype[playerZone[playerid]]+1)][z_name]);
    }
    
GivePlayerCash(playerid, -moneys1);
    
dini_IntSet(AddDirFile(dir_userfilesplayername), "proprented"areatype[playerarea[playerid]][1]);
    
dini_Set(AddDirFile(dir_userfilesplayername), "HouseLocation"strings);
    
dini_Set(AddDirFile(dir_propfilesgiveplayer), "renter"playername);
    
dini_IntSet(AddDirFile(dir_propfilesgiveplayer), "rented"1);
    
DestroyPickup(ppropids[areatype[playerarea[playerid]][1]]);
    
DestroyDynamicMapIcon(pmapicon[areatype[playerarea[playerid]][1]]);
    new 
Float:xFloat:yFloat:z;
    
dini_Float(AddDirFile(dir_propfilesgiveplayer), "X");
    
dini_Float(AddDirFile(dir_propfilesgiveplayer), "Y");
    
dini_Float(AddDirFile(dir_propfilesgiveplayer), "Z");
    
ppropids[areatype[playerarea[playerid]][1]] = CreatePickup(195231xyz, -1);
    
pmapicon[areatype[playerarea[playerid]][1]] = CreateDynamicMapIcon(xyz320, -10, -1600.0MAPICON_LOCAL);
    
format(tmpsizeof(tmp), "Owner: %s\nTenant: %s"dini_Get(AddDirFile(dir_propfilesgiveplayer), "owner"), RPN(playerid));
    
Update3DTextLabelText(ptextlabel[areatype[playerarea[playerid]][1]], 0xFF8533FFtmp);
    for (new 
0PLAYERSi++)
    {
        if (
IsPlayerInRangeOfPoint(i300.0xyz)) Streamer_Update(i);
    }
    
format(string128"You have rented this property for $%d. Welcome to your new home."moneys1);
    
SendClientMessage2(playeridCOLOR_GREENstring);
    
GameTextForPlayer(playerid"~g~~h~~h~Property rented!"50003);
    return 
1;

Reply
#2

bump
Reply
#3

anyone
Reply
#4

bump
Reply
#5

is their anybody who can help here please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)