[Ajuda] Carregar posiзхes de jogado com a include "File"
#9

Quote:
Originally Posted by 1sbedx
Посмотреть сообщение
Tente

PHP код:
CMD:sav(playerid,params[])
{
    new 
str[100],Float:X,Float:Y,Float:Z,Float:Rotation;
    
GetPlayerPos(playerid,X,Y,Z);
    
GetPlayerFacingAngle(playerid,Rotation);
    new 
File:file;
    while(
100)
    {
        
format(str,100,"X_%f,Y_%f,Z_%f,R_%f\r\n",X,Y,Z,Rotation);
        if(
== 0)
        {
            
file fopen("positions.txt",io_write);
        }
        else
        {
            
file fopen("positions.txt",io_append);
        }
        
fwrite(pos,string);
        
fclose(pos);
        
p++;
    }
    return 
1;
}
new 
Float:rX[10],Float:rY[10],Float:rZ[10],Float:rR[10];
CMD:load(playerid,params[])
{
    new 
pos[4];
    new 
string[512];
    new 
Filefile fopen("positions.txt",io_read);
    if(
file)
    {
        new 
0;
        while(
100)
        {
            
fread(file,string);
            
split(string,pos,'|');
            
rX floatstr(pos[0]);
            
rY floatstr(pos[1]);
            
rZ floatstr(pos[2]);
            
rR floatstr(pos[3]);
            
p++;
        }
    }
    return 
1;
}
stock split(const strsrc[],strdest[][],delimiter)
{
    new 
i,li;
    new 
aNum;
    new 
len;
    while(
<= strlen(strsrc))
    {
        if(
strsrc[i] == delimiter || == strlen(strsrc))
        {
            
len strmid(strdest[aNum],strsrc,li,i,128);
            
strdest[aNum][len] = 0;
            
li i+1;
            
aNum++;
        }
        
i++;
    }
    return 
1;

Apareceu esses erros
Код:
C:\Users\Marlon\Desktop\NEW_GM\gamemodes\BCL_mysql.pwn(986) : error: 048: array dimensions do not match
C:\Users\Marlon\Desktop\NEW_GM\gamemodes\BCL_mysql.pwn(986) : error: 033: array must be indexed (variable "rX")
C:\Users\Marlon\Desktop\NEW_GM\gamemodes\BCL_mysql.pwn(986) : error: 033: array must be indexed (variable "rY")
C:\Users\Marlon\Desktop\NEW_GM\gamemodes\BCL_mysql.pwn(986) : error: 033: array must be indexed (variable "rZ")
C:\Users\Marlon\Desktop\NEW_GM\gamemodes\BCL_mysql.pwn(986) : error: 033: array must be indexed (variable "rR")
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)