06.06.2013, 23:28
Код:
CMD:neon(playerid, params[]) { new string[100]; if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any 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; } if(PlayerInfo[playerid][pNeon] == 2)//blue { SetPVarInt(playerid, "neon", CreateDynamicObject(18648,0,0,0,0,0,0)); SetPVarInt(playerid, "neon1", CreateDynamicObject(18648,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "neon"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon1"), 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 blue neon tubes.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 3)//green { SetPVarInt(playerid, "neon4", CreateDynamicObject(18649,0,0,0,0,0,0)); SetPVarInt(playerid, "neon5", CreateDynamicObject(18649,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "neon4"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon5"), 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 green neon tubes.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 4)//white { SetPVarInt(playerid, "neon6", CreateDynamicObject(18652,0,0,0,0,0,0)); SetPVarInt(playerid, "neon7", CreateDynamicObject(18652,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "neon6"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon7"), 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 white neon tubes.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 5)//pink { SetPVarInt(playerid, "neon8", CreateDynamicObject(18651,0,0,0,0,0,0)); SetPVarInt(playerid, "neon9", CreateDynamicObject(18651,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "neon8"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon9"), 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 pink neon tubes.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 6)//yellow { SetPVarInt(playerid, "neon10", CreateDynamicObject(18650,0,0,0,0,0,0)); SetPVarInt(playerid, "neon11", CreateDynamicObject(18650,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "neon10"), GetPlayerVehicleID(playerid), -0.8, 0.0, -0.70, 0.0, 0.0, 0.0); AttachObjectToVehicle(GetPVarInt(playerid, "neon11"), 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 yellow neon tubes.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); neon[playerid] = 0; } if(Bikes(GetPlayerVehicleID(playerid))) { if(PlayerInfo[playerid][pNeon] == 1)//red { SetPVarInt(playerid, "nb1", CreateDynamicObject(18647,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "nb1"), GetPlayerVehicleID(playerid), 0.0, 0.0, -0.70, 0.0, 0.0, 0.0); DestroyObject(GetPVarInt(playerid, "neon2")); DestroyObject(GetPVarInt(playerid, "neon3")); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 2)//blue { SetPVarInt(playerid, "nb2", CreateDynamicObject(18648,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "nb2"), GetPlayerVehicleID(playerid), 0.0, 0.0, -0.70, 0.0, 0.0, 0.0); DestroyObject(GetPVarInt(playerid, "neon")); DestroyObject(GetPVarInt(playerid, "neon1")); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 3)//green { SetPVarInt(playerid, "nb3", CreateDynamicObject(18649,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "nb3"), GetPlayerVehicleID(playerid), 0.0, 0.0, -0.70, 0.0, 0.0, 0.0); DestroyObject(GetPVarInt(playerid, "neon4")); DestroyObject(GetPVarInt(playerid, "neon5")); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 4)//white { SetPVarInt(playerid, "nb4", CreateDynamicObject(18652,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "nb4"), GetPlayerVehicleID(playerid), 0.0, 0.0, -0.70, 0.0, 0.0, 0.0); DestroyObject(GetPVarInt(playerid, "neon6")); DestroyObject(GetPVarInt(playerid, "neon7")); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 5)//pink { SetPVarInt(playerid, "nb5", CreateDynamicObject(18651,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "nb5"), GetPlayerVehicleID(playerid), 0.0, 0.0, -0.70, 0.0, 0.0, 0.0); DestroyObject(GetPVarInt(playerid, "neon8")); DestroyObject(GetPVarInt(playerid, "neon9")); neon[playerid] = 0; } if(PlayerInfo[playerid][pNeon] == 6)//yellow { SetPVarInt(playerid, "nb6", CreateDynamicObject(18650,0,0,0,0,0,0)); AttachObjectToVehicle(GetPVarInt(playerid, "nb6"), GetPlayerVehicleID(playerid), 0.0, 0.0, -0.70, 0.0, 0.0, 0.0); DestroyObject(GetPVarInt(playerid, "neon10")); DestroyObject(GetPVarInt(playerid, "neon11")); neon[playerid] = 0; } } } else { DestroyObject(GetPVarInt(playerid, "neon")); DestroyObject(GetPVarInt(playerid, "neon1")); DestroyObject(GetPVarInt(playerid, "neon2")); DestroyObject(GetPVarInt(playerid, "neon3")); DestroyObject(GetPVarInt(playerid, "neon4")); DestroyObject(GetPVarInt(playerid, "neon5")); DestroyObject(GetPVarInt(playerid, "neon6")); DestroyObject(GetPVarInt(playerid, "neon7")); DestroyObject(GetPVarInt(playerid, "neon8")); DestroyObject(GetPVarInt(playerid, "neon9")); DestroyObject(GetPVarInt(playerid, "neon10")); DestroyObject(GetPVarInt(playerid, "neon11")); DestroyObject(GetPVarInt(playerid, "nb1")); DestroyObject(GetPVarInt(playerid, "nb2")); DestroyObject(GetPVarInt(playerid, "nb3")); DestroyObject(GetPVarInt(playerid, "nb4")); DestroyObject(GetPVarInt(playerid, "nb5")); DestroyObject(GetPVarInt(playerid, "nb6")); format(string, sizeof(string), "* %s pushes a button on his dash and turns off his neon.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); neon[playerid] = 1; return 1; } }