Loading Something From A File
#6

Coordinate X will be in Scriptfiles/Accounts/File1.txt.
Y will be in Scriptfiles/Accounts/File2.txt.
Z will be in Scriptfiles/Accounts/File3.txt.

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/goX"true) == 0)
    {
        new 
Float:Pos[3];
        
Pos[0] = dini_Float("Accounts/File1.txt""Coordinate"); 
        
Pos[1] = dini_Float("Accounts/File2.txt""Coordinate"); 
        
Pos[2] = dini_Float("Accounts/File3.txt""Coordinate"); 
        
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
        
SendClientMessage(playerid0xFFFF00FF"Teleported to saved positions.");
        return 
1;
    }
    return 
0;

It also could be like this:

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/goX"true) == 0)
    {
        
SetPlayerPos(playeriddini_Float("Accounts/File1.txt""Coordinate"), dini_Float("Accounts/File2.txt""Coordinate"), dini_Float("Accounts/File3.txt""Coordinate"));
        
SendClientMessage(playerid0xFFFF00FF"Teleported to saved positions.");
        return 
1;
    }
    return 
0;

Reply


Messages In This Thread
Loading Something From A File - by Tommy_Mandaz - 30.06.2011, 02:38
Re: Loading Something From A File - by Shadoww5 - 30.06.2011, 03:04
Re: Loading Something From A File - by Tommy_Mandaz - 30.06.2011, 03:27
Re: Loading Something From A File - by Shadoww5 - 30.06.2011, 03:56
Re: Loading Something From A File - by Tommy_Mandaz - 30.06.2011, 04:11
Re: Loading Something From A File - by Shadoww5 - 30.06.2011, 04:45
Re: Loading Something From A File - by Tommy_Mandaz - 30.06.2011, 04:47
Re: Loading Something From A File - by Shadoww5 - 30.06.2011, 12:20
Re: Loading Something From A File - by Tommy_Mandaz - 30.06.2011, 13:48
Re: Loading Something From A File - by Sasino97 - 30.06.2011, 15:28

Forum Jump:


Users browsing this thread: 1 Guest(s)