//My Enums
enum hinfo
{
id,
Cost,
Owner[MAX_PLAYER_NAME],
bool:hBought,
VW,
Interior,
Float:extX,
Float:extY,
Float:extZ,
Float:intX,
Float:intY,
Float:intZ,
hpickup,
htext,
};
new pHouse[MAX_HOUSES][hinfo];
/*>>>---Here--->>>>*/UpdateDynamic3DTextLabelText(pHouse[i][htext],0x00B900AF,str5);
forward CreateHouse(hid, cost, Float:x, Float:y, Float:z, bool:Bought,hOwner[24]);
public CreateHouse(hid, cost, Float:x, Float:y, Float:z, bool:Bought,hOwner[24])
{
pHouse[hid][hpickup]=CreateDynamicPickup(1273,1,x,y,z);
if(Bought)
{
new str1[128];
format(str1,sizeof(str1),"House Owner: %s\nHID: %d",hOwner,hid);
/*>>>---Here--->>>>*/ pHouse[hid][htext]=CreateDynamic3DTextLabel(str1,0x00B900AF,x,y,z+1,5);
}
if(!Bought)
{
new str2[128];
format(str2,sizeof(str2),"House for Sale\nCost: $%d\nHID: %d",cost,hid);
/*>>>>and Here--->>>>*/pHouse[hid][htext]=CreateDynamic3DTextLabel(str2,0x00B900AF,x,y,z+1,5);
}
return 1;
}
if(pHouse[i][id]==0)
{
pHouse[i][id]=CreateHouse(i,cost,x,y,z,false,"NULL");
pHouse[i][Cost]=cost;
pHouse[i][hBought]=false;
/*Here-->*/pHouse[i][Owner]="NULL";
pHouse[i][VW]=GetPlayerVirtualWorld(playerid);
pHouse[i][extX]=x;
pHouse[i][extY]=y;
pHouse[i][extZ]=z;
new str3[123];
format(str3, sizeof(str3),"{E85656}[House Created]{FFFFFF} You have successfully created House(ID:%d) Cost: $%d",i,cost);
SendClientMessage(playerid, COLOR_YELLOW,str3);
break;
}
enum hinfo
{
id,
Cost,
Owner[MAX_PLAYER_NAME],
bool:hBought,
VW,
Interior,
Float:extX,
Float:extY,
Float:extZ,
Float:intX,
Float:intY,
Float:intZ,
hpickup,
Text3D:htext <---
};
new pHouse[MAX_HOUSES][hinfo];
pHouse[i][Owner]= Text3D:0; <-- Let's say 0 doesn't have a tag (actually it has, and it is _: ) and you want to store it inside of a variable with Text3D:, so you will have to add a tag to the 0 so you won't get tag mismatch
pHouse[i][Owner]= Text3D:0; <-- Let's say 0 doesn't have a tag (actually it has, and it is _: ) and you want to store it inside of a variable with Text3D:, so you will have to add a tag to the 0 so you won't get tag mismatch
[/pawn] |
native Text3D:Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS=0); native Update3DTextLabelText(Text3D:id, color, text[]);
format(pHouse[i][Owner], MAX_PLAYER_NAME, "NULL" );
first you must know the native of 'Create3DTextLabel' and ' Update3DTextLabelText'
Код:
native Text3D:Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS=0); native Update3DTextLabelText(Text3D:id, color, text[]); change to Код:
format(pHouse[i][Owner], MAX_PLAYER_NAME, "NULL" ); |
Does that means that we can't assign the Value String to a variable directly - Just with = ?
|
Oh.. Thanks.. You Both guys helped me a lot..
Well, can you tell me that How to Return a String..For eg. Returing a string in switch statements? If case 1 then return Red, if case 2 then return Blue Should I do format ? |
stock returncolor(color)
{
new Col[5];
switch(color)
{
case 1: Col = "Red";
case 2: Col = "Blue";
}
return Col;
}