Show Text Question
#1

At the minute when i do /createhouse i creates a green house and on that green house it says " Owned : No " and " Price : - "


What im trying to do is take that away and when you walk over the green house it says on your screen who owns it when it is brought


Here is my code


pawn Код:
CMD:createhouse(playerid,params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"You aren't an admin!");//Check if the player is currently rcon logged in.
    new HousePrice,id = HouseCount;//Creating the house price for the selected value in the command, and the last house id created.
    if(sscanf(params,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>");//Checking if the player uses the correct syntax. The parameter "i" in sscanf means integer, also could be used as "d".
    new Float:x,Float:y,Float:z;//Creating the floats, to store the player's position.
    GetPlayerPos(playerid,x,y,z);//Getting the player's position and storing it
    HInfo[id][Price] = HousePrice;//Setting the house price to the selected one.
    HInfo[id][Owned] = 0;//Setting the house id owned = 0
    HInfo[id][XPos] = x;//Storing the XPos value to the player's x.
    HInfo[id][YPos] = y;//Storing the YPos value to the player's y.
    HInfo[id][ZPos] = z;//Storing the ZPos value to the player's z.
    HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
    format(HInfo[id][Owner],24,"Nonusablenameforthishouse");//Formating the "Owner" house id value to "Nonusablenameforthishouse".
    SendClientMessage(playerid,-1,"House created");
    CreatePickup(1273, 1, x, y, z, GetPlayerVirtualWorld(playerid));//Creating the checkpoint and storing it in the HouseEnter value.
    HouseExit[id] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,GetPlayerVirtualWorld(playerid));//Creating the house exit checkpoint and storing it in the HouseExit value.
    new labelstring[100];//Creating the "file", and the labelstring var.
    new INI:file = INI_Open("FHouse/Houses/%i.ini",id);
    INI_WriteInt(file,"Price",HousePrice);//Writing in the place "Price" the inputted "Price" value.
    INI_WriteInt(file,"Owned",0);//Setting to "Owned" = 0 in the ini file.
    INI_WriteInt(file,"VirtualWorld",GetPlayerVirtualWorld(playerid));//Writing "VirtualWorld" = GetPlayerVirtualWorld(..);
    INI_WriteFloat(file,"XPos",x);//Writing the players pos for the check point position.
    INI_WriteFloat(file,"YPos",y);//Self explanatory.
    INI_WriteFloat(file,"ZPos",z);//Self explanatory.
    INI_WriteString(file,"Owner","Nonusablenameforthishouse");//Writing a string in "Owned" to "Nonusablenameforthishouse"
    //INI_Save();//Saving file with SII.
    INI_Close();//Closing the file with SII.
    format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HousePrice);
    HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
    HouseCount++;
    return 1;
}

Please Help Me Please
Reply
#2

1. This is code copy from a tutorial

2. You should make a TextdrawCreate and public OnplayerEnterDynamicCP

House= HOUSE1

TEXTDRAW
Reply
#3

WTF,how to create textdraw?What are trying to say?

Код:
format(labelstring,sizeof(labelstring),"");
    HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
Reply
#4

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
WTF,how to create textdraw?What are trying to say?

Код:
format(labelstring,sizeof(labelstring),"");
    HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
No i mean it shows up in big letters in the middle of your screen not on the green house


Please Help Me Please
Reply
#5

There are many house scripts in samp forums..
Take a look at them in Filterscript section..
Reply
#6

Ohh,try like this.
Up..
pawn Код:
new HousePickup;
Change
pawn Код:
CreatePickup(1273, 1, x, y, z, GetPlayerVirtualWorld(playerid));
With
pawn Код:
HousePickup = CreatePickup(1273, 1, x, y, z, GetPlayerVirtualWorld(playerid));
And on PlayerPickUpPickup
pawn Код:
if (pickupid == HousePickup )
    {
       new labelstring[64];
       format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HousePrice);
       GameTextForPlayer(playerid, labelstring, 5000, 3);
    }
Delete these.
Код:
format(labelstring,sizeof(labelstring),""Owned: No \nPrice: %i",HousePrice");
    HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
Not sure with string on OnPlayerPickUp..
Reply
#7

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
Ohh,try like this.
Up..
pawn Код:
new HousePickup;
Change
pawn Код:
CreatePickup(1273, 1, x, y, z, GetPlayerVirtualWorld(playerid));
With
pawn Код:
HousePickup = CreatePickup(1273, 1, x, y, z, GetPlayerVirtualWorld(playerid));
And on PlayerPickUpPickup
pawn Код:
if (pickupid == HousePickup )
    {
       new labelstring[64];
       format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HousePrice);
       GameTextForPlayer(playerid, labelstring, 5000, 3);
    }
Delete these.
Код:
format(labelstring,sizeof(labelstring),""Owned: No \nPrice: %i",HousePrice");
    HInfo[id][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,x,y,z,25.0,GetPlayerVirtualWorld(playerid));
Not sure with string on OnPlayerPickUp..
Completely confused may you put it in please


Please Help Me Please
Reply
#8

@Scripter12345


You SERIOUSLEY, Need to Read up on Somthing Things, Before you Ask Questions.
Every Single Question you've Asked, It Goes Somthing like This.

I Made this Code

Код:
//Some Copy & Pasted Code that Goes Into "My" Game mode
Even Though, you Said you "Made It"

Then At the End of Nearly Everything its,

Please Help Me,
I'm Confused put the code in for me


A: What are you Achieving getting Everything done for you?
B: Your Basically Asking, "Script my Game mode for me"


Sorry, to Seem like a Troll.
But its Getting Repetitive and Annoying.




Ezay
\o/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)