Help replacing the text3d
#1

PHP код:
CMD:rentprop(playeridparams[])
{
    new 
playername[25], giveplayeridgiveplayer[25], tmp[2000], string[256], moneys1,strings[40], tmp2[200];
    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]);
    new 
maxtenants dini_Int(AddDirFile(dir_propfilesgiveplayer), "maxtenants");
    
format(tmp2100"renter%d"maxtenants+1);
    
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_IntSet(AddDirFile(dir_propfilesgiveplayer), "tenants"maxtenants);
    
dini_IntSet(AddDirFile(dir_propfilesgiveplayer), "rented"1);
    
dini_Set(AddDirFile(dir_propfilesgiveplayer), tmp2RPN(playerid));
    
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);
    new 
tmp3[200];
    
format(tmp3sizeof(tmp3), "%s%s\n"tmp3dini_Get(AddDirFile(dir_propfilesgiveplayer), tmp2));
    
format(tmpsizeof(tmp), "Owner: %s\nTolet: $%d per day\nTenants: %s\n"dini_Get(AddDirFile(dir_propfilesgiveplayer), "owner"), dini_Int(AddDirFile(dir_propfilesgiveplayer), "rentcost"), tmp3);
    
Update3DTextLabelText(ptextlabel[areatype[playerarea[playerid]][1]], COLOR_ORANGEtmp);
    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;

this cmd replacing my text3dlabel
please
help
over
here
Reply


Messages In This Thread
Help replacing the text3d - by CaptainBoi - 24.09.2018, 10:48
Re: Help replacing the text3d - by CaptainBoi - 24.09.2018, 14:27
Re: Help replacing the text3d - by CaptainBoi - 25.09.2018, 13:34

Forum Jump:


Users browsing this thread: 1 Guest(s)