01.03.2018, 20:26
Use esse cуdigo, nгo testei in-game mas foi compilado, nгo se esqueзa de usar as includes.
PHP код:
//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;
}