ayuda urgente con AttachObjectToVehicle
#1

Reparado
Reply
#2

pawn Код:
new carga1[MAX_PLAYERS];
Reply
#3

pawn Код:
#undef MAX_PLAYERS
#define MAX_PLAYERS 500

new auto[MAX_PLAYERS];//sea visible para todos los jugadores
auto = GetPlayerVehicleID(playerid);//extrae la id del vehiculo
if(auto > 403)//ID del vehiculo
{
    //funciones
}
Reply
#4

Quote:
Originally Posted by junkbuster
Посмотреть сообщение
pawn Код:
new carga1[MAX_PLAYERS];
.pwn(6935) : error 035: argument type mismatch (argument 1)
.pwn(6936) : error 035: argument type mismatch (argument 1)
.pwn(6937) : error 035: argument type mismatch (argument 1)
.pwn(9676) : error 033: array must be indexed (variable "carga1")
.pwn(9677) : error 033: array must be indexed (variable "carga2")
.pwn(967 : error 033: array must be indexed (variable "carga3")
.pwn(39796) : error 035: argument type mismatch (argument 1)
.pwn(39797) : error 035: argument type mismatch (argument 1)
.pwn(3979 : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Reply
#5

Quote:
Originally Posted by PROJECTO
Посмотреть сообщение
.pwn(6935) : error 035: argument type mismatch (argument 1)
.pwn(6936) : error 035: argument type mismatch (argument 1)
.pwn(6937) : error 035: argument type mismatch (argument 1)
.pwn(9676) : error 033: array must be indexed (variable "carga1")
.pwn(9677) : error 033: array must be indexed (variable "carga2")
.pwn(967 : error 033: array must be indexed (variable "carga3")
.pwn(39796) : error 035: argument type mismatch (argument 1)
.pwn(39797) : error 035: argument type mismatch (argument 1)
.pwn(3979 : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Errors.
Intenta poniendo el cтdigo haci:

pawn Код:
for(new i = 0; i <= MAX_PLAYERS; i++)//Significa que podrа ser enviado y utilizado por todos los jugadores.
{
   //funciones
}
ejemplo:

pawn Код:
for(new i = 0; i <= MAX_PLAYERS; i++)
{
new carga1;
carga1 = CreateObject( 1685,0,0,0,0,0,0,80 );
AttachObjectToVehicle( carga1,GetPlayerVehicleID(playerid), 0.000000, 1.300000, 0.400000, 0.000000, 0.000000, 0.000000 );
}
Reply
#6

lo puse asi
for(new i = 0; i <= MAX_PLAYERS; i++)
{
new carga1;
new carga2;
new carga3;

carga1 = CreateObject( 1685,0,0,0,0,0,0,80 );
carga2 = CreateObject( 1685,0,0,0,0,0,0,80 );
carga3 = CreateObject( 1685,0,0,0,0,0,0,80 );
AttachObjectToVehicle( carga1,GetPlayerVehicleID(playerid), 0.000000, 1.300000, 0.400000, 0.000000, 0.000000, 0.000000 );
AttachObjectToVehicle( carga2, GetPlayerVehicleID(playerid), 0.000000, -0.800000, 0.400000, 0.000000, 0.000000, 0.000000 );
AttachObjectToVehicle( carga3, GetPlayerVehicleID(playerid), 0.000000, -2.899999, 0.400000, 0.000000, 0.000000, 0.000000 );
}
me dio errores

pwn(1717) : error 010: invalid function or declaration
pwn(1723) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

Quote:
Originally Posted by pinpon
Посмотреть сообщение
Intenta poniendo el cтdigo haci:

pawn Код:
for(new i = 0; i <= MAX_PLAYERS; i++)//Significa que podrа ser enviado y utilizado por todos los jugadores.
{
   //funciones
}
ejemplo:

pawn Код:
for(new i = 0; i <= MAX_PLAYERS; i++)
{
new carga1;
carga1 = CreateObject( 1685,0,0,0,0,0,0,80 );
AttachObjectToVehicle( carga1,GetPlayerVehicleID(playerid), 0.000000, 1.300000, 0.400000, 0.000000, 0.000000, 0.000000 );
}
NO

pawn Код:
//ya que antes creamos la variable new carga1[MAX_PLAYERS];
carga1[playerid] = CreateObject( 1685,0,0,0,0,0,0,80 );
AttachObjectToVehicle( carga1[playerid],GetPlayerVehicleID(playerid), 0.000000, 1.300000, 0.400000, 0.000000, 0.000000, 0.000000 );
DestroyObject(carga1[playerid]);
// y si lo usas en una callback sin parametros
for(new x=0;x<MAX_PLAYERS;x++)
    carga1[x] = CreateObject(...)
Etc, con estos ejemplos puedes hacerlo
Reply
#8

no entendi ._.
Reply
#9

mira es facil, primero cuando tienes los news declaras la variable

pawn Код:
new carga1[MAX_PLAYERS];
despues vamos al comando o donde la comienzes a usar,

pawn Код:
carga1[playerid] = CreateObject( 1685,0,0,0,0,0,0,80 );
AttachObjectToVehicle( carga1[playerid],GetPlayerVehicleID(playerid), 0.000000, 1.300000, 0.400000, 0.000000, 0.000000, 0.000000 );
y cuando la quieras destruir seguro en otro comando

pawn Код:
DestroyObject(carga1[playerid]);
y si vas a crear los objetos en OnGameModeInit crear o destruir
pawn Код:
for(new x=0;x<MAX_PLAYERS;x++)
    carga1[x] = CreateObject( 1685,0,0,0,0,0,0,80 );

// y para destruir
for(new x=0;x<MAX_PLAYERS;x++)
    DestroyObject(carga1[x]);
Reply
#10

Reparado
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)