[Ajuda] Erro com Comando
#1

Erro
Код:
new2.pwn(2529) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Code como posso melhora-lo? e arrumar o erro
Код:
GiveVehicle(playerid, vehicleid, color1, color2)
{
    if(!IsPlayerInAnyVehicle(playerid))
    {
        	if(CreatedVehicle[playerid]) {
            DestroyVehicle(CreatedVehicle[playerid]);
            CreatedVehicle[playerid] = 0;
		}

        new Float:x, Float:y, Float:z, Float:angle, string2[85];
        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, angle);

        CreatedVehicle[playerid] = CreateVehicle(vehicleid, x, y, z, angle, color1, color2, -1);

        SetVehicleVirtualWorld(CreatedVehicle[playerid], GetPlayerVirtualWorld(playerid));
        LinkVehicleToInterior(CreatedVehicle[playerid], GetPlayerInterior(playerid));
        PutPlayerInVehicle(playerid, CreatedVehicle[playerid], 0);

        format(string2,sizeof(string2),"{FF0000}INFO SERVE{FFFFFF}Vocк criou o veнculo %s ID: %d", VehicleNames[vehicleid-400],vehicleid);
        SendClientMessage(playerid, -1, string2);
        return 1;
    }
    return 0;
}
Reply
#2

PHP код:
GiveVehicle(playeridvehicleidcolor1color2)
{
    if(!
IsPlayerInAnyVehicle(playerid))
    {
        if(
CreatedVehicle[playerid]) {
        
            
DestroyVehicle(CreatedVehicle[playerid]);
            
CreatedVehicle[playerid] = 0;
        }

        new 
Float:xFloat:yFloat:zFloat:anglestring2[85];
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playeridangle);

        
CreatedVehicle[playerid] = CreateVehicle(vehicleidxyzanglecolor1color2, -1);

        
SetVehicleVirtualWorld(CreatedVehicle[playerid], GetPlayerVirtualWorld(playerid));
        
LinkVehicleToInterior(CreatedVehicle[playerid], GetPlayerInterior(playerid));
        
PutPlayerInVehicle(playeridCreatedVehicle[playerid], 0);

        
format(string2,sizeof(string2),"{FF0000}INFO SERVE{FFFFFF}Vocк criou o veнculo %s ID: %d"VehicleNames[vehicleid-400],vehicleid);
        
SendClientMessage(playerid, -1string2);
        return 
1;
    }
    return 
0;

Reply
#3

o comando n efetua por nome e sim por ids ( como faзo pra arruma ?)
Код:
CMD:car(playerid,params[])
{
    new veh[30], vehid, cor1, cor2;
    
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)      	return SendClientMessage(playerid, CorErro, "Vocк nгo pode criar um carro estando dentro de um.");
    if(sscanf(params, "iii", Numero, cor1, cor2))				return SendClientMessage(playerid, CorErro, "USE: /car [ID] [COR1] [COR2]");
	if(sscanf(params,"s[30]dd",veh,cor1,cor2)) 					return SendClientMessage(playerid, CorErro, "USE [NOME OU ID] entre 400 e 611");

    if(IsNumeric(veh)) vehid = strval(veh);
        else vehid = ReturnVehicleModelID(veh);

    if(vehid < 400 || vehid > 611) 								return SendClientMessage(playerid, CorErro,"[AVISO] Veнculo invalido");
   	{
		if(vehid == 520 || vehid == 432 || vehid == 592 || vehid == 425 ||
		vehid == 464 || vehid == 406 || vehid == 476 || vehid == 447) return SendClientMessage(playerid, CorErro, "Este veнculo nгo й permitido neste mundo.");
	}
	GiveVehicle(playerid, vehid, cor1, cor2);
	FoiCriado[ID] = true;
    return 1;
}
Reply
#4

Usa o search, amigгo.
Reply
#5

Ips luan jб dei uma pesquisada e n achei nada parecido
Reply
#6

Quote:
Originally Posted by VinnyScript
Посмотреть сообщение
o comando n efetua por nome e sim por ids ( como faзo pra arruma ?)
Код:
CMD:car(playerid,params[])
{
    new veh[30], vehid, cor1, cor2;
    
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)      	return SendClientMessage(playerid, CorErro, "Vocк nгo pode criar um carro estando dentro de um.");
    if(sscanf(params, "iii", Numero, cor1, cor2))				return SendClientMessage(playerid, CorErro, "USE: /car [ID] [COR1] [COR2]");
	if(sscanf(params,"s[30]dd",veh,cor1,cor2)) 					return SendClientMessage(playerid, CorErro, "USE [NOME OU ID] entre 400 e 611");

    if(IsNumeric(veh)) vehid = strval(veh);
        else vehid = ReturnVehicleModelID(veh);

    if(vehid < 400 || vehid > 611) 								return SendClientMessage(playerid, CorErro,"[AVISO] Veнculo invalido");
   	{
		if(vehid == 520 || vehid == 432 || vehid == 592 || vehid == 425 ||
		vehid == 464 || vehid == 406 || vehid == 476 || vehid == 447) return SendClientMessage(playerid, CorErro, "Este veнculo nгo й permitido neste mundo.");
	}
	GiveVehicle(playerid, vehid, cor1, cor2);
	FoiCriado[ID] = true;
    return 1;
}
use em base do meu e veja oq estб errado
PHP код:
CMD:car(playeridparams[])
{
    new 
CarrointVehCor1Cor2Float:cXFloat:cYFloat:cZ;
    if(
sscanf(params,"iii"VehCor1Cor2)) return SendClientMessage(playerid, -1"[SERVER]: Use: /car [ID] [Cor] [Co]");
    if(
Veh 400) return SendClientMessage(playerid, -1"[SERVER]: Invalid Vehicle ID.");
    
GetPlayerPos(playeridcXcYcZ);
    
Carro CreateVehicle(VehcXcYcZ+10Cor1Cor2, -1);
    
int GetPlayerInterior(playerid), LinkVehicleToInterior(Carroint);
    
PutPlayerInVehicle(playeridCarro0);
    return 
1;

@edit
nгo sei se estou certo mas
PHP код:
    if(sscanf(params,"ddd",veh,cor1,cor2)) 
Reply
#7

Quote:
Originally Posted by iSoaD
Посмотреть сообщение
nгo sei se estou certo mas
PHP код:
    if(sscanf(params,"ddd",veh,cor1,cor2)) 
i Integer (whole number)
d Integer (whole number).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)