[Ajuda] car bugado ;-;
#1

estou com meu carro de boa ;-; dae qualquer player do serve cria um carro e o meu some ;-; ajuda ?
Код:
CMD:car(playerid,params[]) {
    new
		veh[30],
		vehid,
		cor1,
		cor2
	;

	if(sscanf(params,"s[30]dd",veh,cor1,cor2)) return SendClientMessage(playerid,-1,"{FF0000}[ERRO] {C3C3C3} /car [nome ou ID] [cor1] [cor2]");

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

    if(vehid < 400 || vehid > 611) return SendClientMessage(playerid,-1,"{00FF00}» ! « {FFFFFF} Veнculo invalido");
   	{
	if(vehid == 520 || vehid == 432 || vehid == 592 || vehid == 425 ||
	vehid == 464 || vehid == 406 || vehid == 476 || vehid == 447) return SendClientMessage(playerid, RED, "[INFO] Este veнculo nгo й permitido neste mundo.");
	}
	GiveVehicle(playerid,vehid,cor1,cor2);
    return 1;
}
Reply
#2

Mande a funзгo "GiveVehicle"
Reply
#3

Код:
GiveVehicle(playerid,vehicleid, color1, color2)
{
	if(!IsPlayerInAnyVehicle(playerid))
	{
	    new Float:x,
			Float:y,
			Float:z,
			Float:angle,
			string2[85]
		;

	    if(CreatedVehicle[playerid]) DestroyVehicle(CreatedVehicle[playerid]);

		GetPlayerPos(playerid, x, y, z);
	 	GetPlayerFacingAngle(playerid, angle);

	    new veh = CreateVehicle(vehicleid, x, y, z, angle, color1, color2, -1);

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

		format(string2,sizeof(string2),"{00FF00}» Info « {FFFFFF}Vocк criou o veнculo %s ID: %d", VehicleNames[vehicleid-400],vehicleid);
		return SendClientMessage(playerid, -1, string2);
	}
	return 1;
}
poderia ver a funзao de destruir o antigo carro q ele criou tbm .0. ficaria melhor tbm
Reply
#4

pawn Код:
GiveVehicle(playerid,vehicleid, color1, color2)
{
    if(!IsPlayerInAnyVehicle(playerid))
    {
        new Float:x,
            Float:y,
            Float:z,
            Float:angle,
            string2[85]
        ;

        if(CreatedVehicle[playerid]) DestroyVehicle(CreatedVehicle[playerid]);

        GetPlayerPos(playerid, x, y, z);
        GetPlayerFacingAngle(playerid, angle);

        new veh = CreateVehicle(vehicleid, x, y, z, angle, color1, color2, -1);

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

        format(string2,sizeof(string2),"{00FF00}» Info « {FFFFFF}Vocк criou o veнculo %s ID: %d", VehicleNames[vehicleid-400],vehicleid);
        return SendClientMessage(playerid, -1, string2);
    }
    return 1;
}
Reply
#5

Vou ver aqui ;-;
Reply
#6

pawn Код:
GiveVehicle(playerid,vehicleid, color1, color2)
{
    if(!IsPlayerInAnyVehicle(playerid))
    {
        if(CreatedVehicle[playerid])
            DestroyVehicle(CreatedVehicle[playerid]);
       
        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),"{00FF00}» Info « {FFFFFF}Vocк criou o veнculo %s ID: %d", VehicleNames[vehicleid-400],vehicleid);
        SendClientMessage(playerid, -1, string2);
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)