28.01.2016, 00:27
Ok so I use /neon, it opens the dialog and let me choose between many colors ( i just pasted the red one as its the same for every other colors ) and then the neon tube ( object ) doesnt appear on car. Any help ?
Heres the code
Thanks a LOT
Heres the code
PHP код:
CMD:neon(playerid, params[])
{
new string[100];
if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle.");
if(GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVeh] && GetPlayerVehicleID(playerid) != PlayerInfo[playerid][pVVeh]) return SendClientMessage(playerid, COLOR_GREY, "You are not in an owned vehicle.");
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pVeh])
{
if(neon[playerid] == 1)
{
if(PlayerInfo[playerid][pNeon] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You don't have neons installed on this vehicle.");
}
if(PlayerInfo[playerid][pNeon] == 1)//red
{
SetPVarInt(playerid, "neon2", CreateDynamicObject(18647,0,0,0,0,0,0));
SetPVarInt(playerid, "neon3", CreateDynamicObject(18647,0,0,0,0,0,0));
AttachObjectToVehicle(GetPVarInt(playerid, "neon2"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
AttachObjectToVehicle(GetPVarInt(playerid, "neon3"), GetPlayerVehicleID(playerid), 0.8, 0.0, -0.70, 0.0, 0.0, 0.0);
format(string, sizeof(string), "* %s pushes a button on his dash and sparks his red neon tubes.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
neon[playerid] = 0;
}