01.03.2018, 19:43
Bom alguem tem um code simples pra me passa ae que й tipo quando crio um veiculo fica o nick do player e id dele que criou jб vi nos codes pra ajudar mais caзei e nгo achei
//Includes
#include <sscanf2>
#include <ZCMD>
CMD:veiculo (playerid, params[])
{
new String[128], Nome[24], Model, Veiculo, Cor1, Cor2,
Float:X, Float:Y, Float:Z, Float:Angle;
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Primeiro saia do veiculo atual.");
if(sscanf(params, "ddd", Model, Cor1, Cor2)) return SendClientMessage(playerid, -1, "Use: /veiculo (ID) (Cor1) (Cor2)");
if(IsPlayerConnected(playerid))
{
if(Model >= 400 && Model <= 611)
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
Veiculo = AddStaticVehicleEx(Model, X, Y, Z, Angle, Cor1, Cor2, 30);
LinkVehicleToInterior(Veiculo, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(Veiculo, GetPlayerVirtualWorld(playerid));
GetPlayerName(playerid, Nome, sizeof(Nome));
format(String, sizeof(String), "Olб %s, vocк criou o veнculo ID: %d", Nome, Model);
SendClientMessage(playerid, -1, String);
}
else
SendClientMessage(playerid, -1, "Veiculo invбlido, use id's de 400 a 611");
}
return 1;
}
CMD:veiculo (playerid, params[])
{
new Text3D:vehicle3Dtext[MAX_VEHICLES];
new String[128], Nomee[24], Model, Veiculo, Cor1, Cor2,
Float:X, Float:Y, Float:Z, Float:Angle;
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "Primeiro saia do veiculo atual.");
if(sscanf(params, "ddd", Model, Cor1, Cor2)) return SendClientMessage(playerid, -1, "Use: /veiculo (ID) (Cor1) (Cor2)");
if(IsPlayerConnected(playerid))
{
if(Model >= 400 && Model <= 611)
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Angle);
Veiculo = AddStaticVehicleEx(Model, X, Y, Z, Angle, Cor1, Cor2, 30);
LinkVehicleToInterior(Veiculo, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(Veiculo, GetPlayerVirtualWorld(playerid));
PutPlayerInVehicle(playerid, Veiculo, 0);
GetPlayerName(playerid, Nomee, sizeof(Nomee));
format(String, sizeof(String), "Olб %s, vocк criou o veнculo ID: %d", Nomee, Model);
SendClientMessage(playerid, -1, String);
new msgf[25];
format(msgf, sizeof(msgf), "%s(%02d) id: %d", Nomee,playerid, Veiculo); // AQUI
vehicle3Dtext[ Veiculo ] = Create3DTextLabel(msgf, -1, 0.0, 0.0, 0.0, 50.0, 0, 1 );// AQUI
Attach3DTextLabelToVehicle( vehicle3Dtext[ Veiculo ] , Veiculo, 0.0, 0.0, 0.0);// AQUI
}
else
SendClientMessage(playerid, -1, "Veiculo invбlido, use id's de 400 a 611");
}
return 1;
}