Help with house spawn
#1

So I have a /hspawn , /hgoto /dshouse command it all does the magic near his house entrance but it would be much better if i could set him to spawn inside the house interior and also teleport to an interior also set his virtualworld if somebody could help me with this im glad to rep you

PHP код:
public OnPlayerSpawn(playerid)
{
    new 
spawn[256], pname[24], Float:NewXFloat:NewYFloat:NewZ;
    
GetPlayerName(playeridpnamesizeof(pname));
    
format(spawnsizeof(spawn), FILE_NAMEudb_encode(pname));
    if(
dini_Exists(spawn) == 1)
      {
           
NewX dini_Float(spawn"X");
           
NewY dini_Float(spawn"Y");
           
NewZ dini_Float(spawn"Z");
           
SetPlayerPos(playeridNewXNewYNewZ);
           
SendClientMessage(playerid0x0000CDAA,"House spawn loaded...");
      }
      else
      {
          
SendClientMessage(playerid0x0000CDAA"No shouse spawn loaded, Your can save one with /hspawn");
      }
    return 
1;
}
     
COMMAND:hspawn (playeridparams[])
     {
          new 
make[256], pname[24], Float:LastXFloat:LastYFloat:LastZ;
          
GetPlayerName(playeridpnamesizeof(pname));
          
format(makesizeof(make), FILE_NAMEudb_encode(pname));
          
dini_Create(make);
          
GetPlayerPos(playeridLastXLastYLastZ);
          
dini_FloatSet(make"X"LastX);
          
dini_FloatSet(make"Y"LastY);
          
dini_FloatSet(make"Z"LastZ);
          
SendClientMessage(playerid0x0000CDAA,"House spawn is set!");
          return 
1;
     }
     
COMMAND:ghouse (playeridparams[])
     {
        new 
str1[256], pname[24];
        
GetPlayerName(playeridpnamesizeof(pname));
         
format(str1sizeof(str1), FILE_NAMEudb_encode(pname));
        if (
dini_Exists(str1))
          {
                new 
Float:GotoXFloat:GotoYFloat:GotoZ;
                
GotoX dini_Float(str1"X");
                
GotoY dini_Float(str1"Y");
                
GotoZ dini_Float(str1"Z");
                
SetPlayerPos(playerid,GotoX,GotoY,GotoZ);
                
SendClientMessage(playerid0x0000CDAA,"Your teleported to your House!");
          }
          else
          {
                
SendClientMessage(playerid0x0000CDAA,"ERROR:File not found");
          }
        return 
1;
     }
     
COMMAND:dshouse (playeridparams[])
     {
        new 
str1[256], pname[24];
        
GetPlayerName(playeridpnamesizeof(pname));
         
format(str1sizeof(str1), FILE_NAMEudb_encode(pname));
        if (
dini_Exists(str1))
          {
                
dini_Remove(str1);
                
SendClientMessage(playerid0x0000CDAA"House spawn removed!");
          }
          else
          {
                
SendClientMessage(playerid0x0000CDAA,"ERROR:House spawn doesn't exist!");
          }
        return 
1;
      } 
Reply
#2

Using dini isn't a smart move.

Tho, do you mean code it for you or you did you code it and are facing issues solving them?

The question isn't clear.

You can use the well-obvious commands
SetPlayerVirtualWorld
SetPlayerInterior

You can find a list of native functions here:
https://sampwiki.blast.hk/wiki/Functions
Reply
#3

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Using dini isn't a smart move.

Tho, do you mean code it for you or you did you code it and are facing issues solving them?

The question isn't clear.

You can use the well-obvious commands
SetPlayerVirtualWorld
SetPlayerInterior

You can find a list of native functions here:
https://sampwiki.blast.hk/wiki/Functions
I figured it out myself and btw im using dini2 which is on pair with todays Y_ini thanks anyways
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)