[ajuda] Colocar varios carros so com um new -
Rick_DR - 28.04.2012
Pessoal tenho aqui uma duvida queria colocar varios carros com o mesmo new serб possivel ?
pawn Код:
SetVehicleNumberPlate(CreateVehicle(559,-1660.9938,1213.9456,6.9063,251.3777,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(568,-1663.8159,1225.0376,13.5401,222.2662,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(565,-1649.4563,1208.2445,13.5128,74.0341,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(536,-1676.8442,1207.4634,13.4113,228.5095,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(467,-1656.9700,1215.0920,13.4119,294.5504,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(587,-1664.7211,1225.1965,20.8832,223.6170,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(404,-1647.1122,1205.5983,20.8877,251.4909,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(560,-1654.9934,1217.7535,20.8622,228.3566,126,0,100), "Stand"); //
SetVehicleNumberPlate(CreateVehicle(575,-1670.3381,1203.3840,20.7596,271.2746,126,0,100), "Stand");
Em ves disto eu criava
pawn Код:
Stand =
{
CreateVehicle(559,-1660.9938,1213.9456,6.9063,251.3777,126,0,100); //
CreateVehicle(568,-1663.8159,1225.0376,13.5401,222.2662,126,0,100); //
CreateVehicle(565,-1649.4563,1208.2445,13.5128,74.0341,126,0,100); //
CreateVehicle(536,-1676.8442,1207.4634,13.4113,228.5095,126,0,100); //
CreateVehicle(467,-1656.9700,1215.0920,13.4119,294.5504,126,0,100); //
CreateVehicle(587,-1664.7211,1225.1965,20.8832,223.6170,126,0,100); //
CreateVehicle(404,-1647.1122,1205.5983,20.8877,251.4909,126,0,100); //
CreateVehicle(560,-1654.9934,1217.7535,20.8622,228.3566,126,0,100); //
CreateVehicle(575,-1670.3381,1203.3840,20.7596,271.2746,126,0,100);
}
assim depois era so meter
pawn Код:
SetVehicleNumberPlate(Stand, "Stand");
isto tambem me ia ajudar a reservar os carros para as ORG
so que assim nao da, alguem me ajuda ?
Re: [ajuda] Colocar varios carros so com um new -
WLSF - 28.04.2012
pawn Код:
new Stand[9];
Stand[0] = CreateVehicle(559,-1660.9938,1213.9456,6.9063,251.3777,126,0,100); //
Stand[1] = CreateVehicle(568,-1663.8159,1225.0376,13.5401,222.2662,126,0,100); //
Stand[2] = CreateVehicle(565,-1649.4563,1208.2445,13.5128,74.0341,126,0,100); //
Stand[3] = CreateVehicle(536,-1676.8442,1207.4634,13.4113,228.5095,126,0,100); //
Stand[4] = CreateVehicle(467,-1656.9700,1215.0920,13.4119,294.5504,126,0,100); //
Stand[5] = CreateVehicle(587,-1664.7211,1225.1965,20.8832,223.6170,126,0,100); //
Stand[6] = CreateVehicle(404,-1647.1122,1205.5983,20.8877,251.4909,126,0,100); //
Stand[7] = CreateVehicle(560,-1654.9934,1217.7535,20.8622,228.3566,126,0,100); //
Stand[8] = CreateVehicle(575,-1670.3381,1203.3840,20.7596,271.2746,126,0,100);
Estгo na mesma variбvel...
Re: [ajuda] Colocar varios carros so com um new -
RoacH` - 28.04.2012
Exemplo:
pawn Код:
public OnGameModeInit()
{
new stand [ 5 ] ;
stand [ 0 ] = CreateVehicle ( 559 ,-1660.9938 ,1213.9456 ,6.9063 ,251.3777 ,126 ,0 ,100 ) ;
stand [ 1 ] = CreateVehicle ( 559 ,-1660.9938 ,1213.9456 ,6.9063 ,251.3777 ,126 ,0 ,100 ) ;
stand [ 2 ] = CreateVehicle ( 559 ,-1660.9938 ,1213.9456 ,6.9063 ,251.3777 ,126 ,0 ,100 ) ;
stand [ 3 ] = CreateVehicle ( 559 ,-1660.9938 ,1213.9456 ,6.9063 ,251.3777 ,126 ,0 ,100 ) ;
SetVehicleNumberPlate ( stand [ 0 ] || stand [ 1 ] || stand [ 2 ] || stand [ 3 ] , "Stand" ) ;
return 1;
}
Nгo tenho certeza de que seja funcional.
Re: [ajuda] Colocar varios carros so com um new -
telmo_ferreira - 28.04.2012
pawn Код:
for(new i; i <= sizeof(stand); i++)
{
SetVehicleNumberPlate(Stand[i], "Stand");
}
Re: [ajuda] Colocar varios carros so com um new -
Rick_DR - 28.04.2012
e para aplicar isto como seria ?
pawn Код:
if(newstate == PLAYER_STATE_DRIVER) {
new Vehicle = GetPlayerVehicleID(playerid);
if(Vehicle == stand) {
if(strcmp(PlayerName,"petrum32",true)) {
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(Stand, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(Stand, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob);
SendClientMessage(playerid, 0x33AA33AA, "Carro do Stand");
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
new string[248];
format(string,sizeof(string),"{FFDD00}ALARME: {89A0FA}O {E80E24}%s {89A0FA}esta dentro de um carro do stand!",pName);
SendClientMessageToAll(0x679660AA, string);
}
}
}