Help With Garage
#1

Hello I Creating Simple Garage System But Now I Have A Problem..


This Is What Happen When I Go On The Pickup :


Код:
 
  if(pickupid == pickups[0][gar1])//1
  {
  ShowPlayerDialog(playerid,3301,DIALOG_STYLE_MSGBOX,"GARAGE","Garage Number: 1\nGarage Price : 500 000LT\nDo You Want To Buy This Garage?","Yes","No");
  return 1;
  }
Response :

Код:
new Text3D:Garage;
if(dialogid==3301)
{
if(response)
{
if(GetPlayerMoneyA(playerid) < 500000)
{
SendClientMessage(playerid,RED,"* You Don't Have: 500000$");
return 0;
}
if(GetPlayerScore(playerid) < 5500)
{
SendClientMessage(playerid,RED,"You Don't Have 5500Score");
return 0;
}
new dtext[250];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(dtext,sizeof(dtext),"{FFAF00}Garage Number: {00FFEE}1\n{FFAF00}Price: {6EF83C}500 000LT\n{FFAF00}Owner: {11B5BE}%s",name);
Update3DTextLabelText(Garage,-1,dtext);
GivePlayerMoneyA(playerid,-500000);
new file[200];
format(file,sizeof(file),"saves/garage1.txt");
if(!fexist(file)) dini_Create("saves/garage1.txt");
dini_Set(file,"Owner",name);
return 1;
}
}
Код:
public OnGameModeInit()
{
Garage = Create3DTextLabel("{FFAF00}Garage Number: {00FFEE}1\n{FFAF00}Price: {6EF83C}500 000LT\n{FFAF00}Owner: {F81414}Nobody!",-1,-2097.4521,386.0324,35.1719, 20, 0, 1);
Now With This I Have A Problem..

When I Bought Garage 3d text updating and then write Owner: name, but then you off the server,

and again logged to the server writing Owner: nobody.

So maybe someone can help with this ?

I don't know what else I must do
Reply
#2

Looking Strange
Reply
#3

Yeah, it's not looking strange, you're not loading the data from the files...

At OnGameModeInit( )
pawn Код:
public OnGameModeInit()
{
    new file[ 30 ]; format( file, 30,"saves/garage1.txt" );
    new s_O[ MAX_PLAYER_NAME ];
    if( fexist( file ) ) dini_Get( file, "Owner", s_O );

    new 3D_Text[ 100 ];
    format( 3D_Text, 100, "{FFAF00}Garage Number: {00FFEE}1\n{FFAF00}Price: {6EF83C}500 000LT\n{FFAF00}Owner: {11B5BE}%s", s_O);
    Update3DTextLabelText( Garage, -1, 3D_Text );

    return ( 1 );
}
Something like this
Reply
#4

Thanks I Try It
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)