[Ayuda] Error al querer setear string en variable
#1

Buenas, quisiera que me ayudasen con un comando, ya que intento setear string en la variable y no me deja.
PHP код:
CMD:crearobjeto(playeridparams[])
{
    if(
Informacion[playerid][pAdmin] < 4) return 0;
    if(
sscanf(params,"i",params[0])) return SendClientMessage(playerid, -1"/CrearObjeto (Utilidad) - /Utilidades");
    if(
ObjectID >= MAX_OBJETOS) return SendClientMessage(playerid, -1"No puedes crear mбs objetos.");
    new 
Float:Pos[3];
    
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
     
InformacionO[ObjectID][O_POS][0] = Pos[0];
      
InformacionO[ObjectID][O_POS][1] = Pos[1];
       
InformacionO[ObjectID][O_POS][2] = Pos[2]-1.0;
       
InformacionO[ObjectID][O_ID] = ObjectID;
       new 
ola[16];
    switch(
params[0])
    {
        case 
1:
        {
            
InformacionO[ObjectID][O_MODEL] = 2814;
            
InformacionO[ObjectID][O_UTIL] = 1;
            
format(olasizeof(ola), "Pizza");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(2814Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
            
        }
        case 
2:
        {
            
InformacionO[ObjectID][O_MODEL] = 1668;
            
InformacionO[ObjectID][O_UTIL] = 2;
            
format(olasizeof(ola), "Agua");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(1668Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
        }
        case 
3:
        {
            
InformacionO[ObjectID][O_MODEL] = 1580;
            
InformacionO[ObjectID][O_UTIL] = 3;
            
format(olasizeof(ola), "Botiquin");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(1580Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
        }
        case 
4:
        {
            
InformacionO[ObjectID][O_MODEL] = 3026;
            
InformacionO[ObjectID][O_UTIL] = 4;
            
format(olasizeof(ola), "Mochila chica");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(3026Pos[0], Pos[1], Pos[2]-1.0, -90.000000.00.0, -1, -1, -1200.050.0);
        }
        case 
5:
        {
            
InformacionO[ObjectID][O_MODEL] = 371;
            
InformacionO[ObjectID][O_UTIL] = 5;
            
format(olasizeof(ola), "Mochila mediana");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(371Pos[0], Pos[1], Pos[2]-1.0, -90.000000.00.0, -1, -1, -1200.050.0);
        }
        case 
6:
        {
            
InformacionO[ObjectID][O_MODEL] = 1310;
            
InformacionO[ObjectID][O_UTIL] = 6;
            
format(olasizeof(ola), "Mochila grande");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(1310Pos[0], Pos[1], Pos[2]-1.090.000000.00.0, -1, -1, -1200.050.0);
        }
        case 
7:
        {
            
InformacionO[ObjectID][O_MODEL] = 1650;
            
InformacionO[ObjectID][O_UTIL] = 7;
            
format(olasizeof(ola), "Bidon");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(1650Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
        }
        case 
8:
        {
            
InformacionO[ObjectID][O_MODEL] = 1650;
            
InformacionO[ObjectID][O_UTIL] = 8;
            
format(olasizeof(ola), "Bidon");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(1650Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
        }
        case 
9:
        {
            
InformacionO[ObjectID][O_MODEL] = 2856;
            
InformacionO[ObjectID][O_UTIL] = 9;
            
format(olasizeof(ola), "Cajas de leche");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(2856Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
        }
        case 
10:
        {
            
InformacionO[ObjectID][O_MODEL] = 2647;
            
InformacionO[ObjectID][O_UTIL] = 10;
            
format(olasizeof(ola), "Soda");
            
InformacionO[ObjectID][O_NAME] = ola;
            
Objeto[ObjectID] = CreateDynamicObject(2647Pos[0], Pos[1], Pos[2]-1.00.00.00.0, -1, -1, -1200.050.0);
        }
    }
    new 
asd[128];
    
format(asdsizeof(asd), "{007200}%s\n{007200}Preciona '{00C3EA}AltIzq{007200}' para recoger",InformacionO[ObjectID][O_NAME]);
    
LabelObj[ObjectID] = CreateDynamic3DTextLabel(asd, -1InformacionO[ObjectID][O_POS][0],InformacionO[ObjectID][O_POS][1],InformacionO[ObjectID][O_POS][2], 5.0);
    
ActualizarObjeto(ObjectID);
    
Iter_Add(iObjetosObjectID);
    
ObjectID++;
    return 
1;

Quote:

C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(357) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(366) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(374) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(382) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(390) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(39 : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(406) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(414) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(422) : error 047: array sizes do not match, or destination array is too small
C:\Users\Equipo\Desktop\Servidor samp\gamemodes\ZombieSV.pwn(430) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


10 Errors.

Enum en el que tengo definida la variable del string.
PHP код:
enum InfoObjetos
{
    
O_NAME[32],
    
O_ID,
    
O_MODEL,
    
O_UTIL,
    
Float:O_POS[3]
};
new 
InformacionO[MAX_OBJETOS][InfoObjetos]; 
Reply
#2

Код:
format(InformacionO[ObjectID][O_NAME],32,"string");
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)