Quantcast
Channel: SA-MP Forums - Filterscripts
Viewing all articles
Browse latest Browse all 595

[FilterScript] Sistema Sound-Card by Abraham_Blanco

$
0
0
Bueno amigos este es un pequeño sistema que he creado para colocar una corneta o bocina en el maletero de tu auto

las IDs de los vehículos configurados son:

ID del modelo del vehículo : 558
Nombre del vehículo : Urano
Categoría :
Modificaciones de vehículos deportivos : Ángeles del arco de la rueda
Nombre del modelo : urano

ID del modelo de vehículo : 559
Vehículo Nombre : Jester
Categoría vehículos deportivos:
Modificaciones : Ángeles del arco de la rueda
Nombre del modelo : bufón

ID del modelo del vehículo : 560
Nombre del vehículo : Sultan
Categoría : Salones
Modificaciones : Ángeles del arco de la rueda
Nombre del modelo : sultan

ID del modelo del vehículo : 565
Nombre del vehículo :
Categoría del flash :
Modificaciones de vehículos deportivos : Angelinos del arco de la rueda
Nombre del modelo : flash

CMDS COMANDOS:

/bocina al colocar este cmd saldrá la bocina en el maletero del coche
/ponermusica este cmd es para colocar algun link musica formato stream .mp3



Code:

#include <a_samp>
#include <streamer>
#define rojo 0xFF0000C8
#define D_MUSICA    (993)

//================================================================================
new i;
new luz[7];
new nobocina[MAX_VEHICLES] = 0;
new corneta[MAX_VEHICLES];
new corneta2[MAX_VEHICLES];
new Float:X, Float:Y, Float:Z;
public OnPlayerCommandText(playerid, cmdtext[])
{
//==================================================================================
if (strcmp("/ponermusica", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,rojo, "No estás en un vehiculo.");
ShowPlayerDialog(playerid, D_MUSICA, DIALOG_STYLE_INPUT, "{FFFF00}SONIDO{000080} SOUND{FF0000} CAR","LINK!",">>","X");
return 1;
}
//===============================================================================
if (strcmp("/bocina", cmdtext, true, 10) == 0)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,rojo, "No estás en un vehiculo.");
new vehicleid = GetPlayerVehicleID(playerid);
if(nobocina[vehicleid] == 0){
nobocina[vehicleid] = 1;

if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 558){
SendClientMessage(playerid,rojo, "{00FF00}Bien!! Ahora pon{FF0000} /ponersonido  {0000FF}y agrega tu musica de preferencia..");

corneta[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
corneta2[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
AttachObjectToVehicle(corneta[vehicleid], GetPlayerVehicleID(playerid) ,0.0, -2.0,0.6,-30.0,-90.0, 0.0);
AttachObjectToVehicle(corneta2[vehicleid], GetPlayerVehicleID(playerid),0.0, -2.0,0.6,-30.0,90.0, 0.0);
luz[4] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
luz[5] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
AttachObjectToVehicle(luz[4], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
AttachObjectToVehicle(luz[5], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 1, 0,0, 0, 1, 0);
PlayerPlaySound(playerid,1058,0,0,0);
}
//==============================================================================
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 565){
SendClientMessage(playerid,rojo, "{00FF00}Bien!! Ahora pon{FF0000} /ponersonido  {0000FF}y agrega tu musica de preferencia..");SetPVarInt(playerid, "Status", 1);

corneta[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
corneta2[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
luz[4] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
luz[5] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
AttachObjectToVehicle(luz[4], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
AttachObjectToVehicle(luz[5], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
AttachObjectToVehicle(corneta[vehicleid], GetPlayerVehicleID(playerid) ,0.0, -1.6,0.1,-20.0,-90.0, 0.0);
AttachObjectToVehicle(corneta2[vehicleid] , GetPlayerVehicleID(playerid),0.0, -1.6,0.1,-20.0,90.0, 0.0);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 1, 0,0, 0, 1, 0);
PlayerPlaySound(playerid,1058,0,0,0);
}
//==============================================================================
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 560){
SendClientMessage(playerid,rojo, "{00FF00}Bien!! Ahora pon{FF0000} /ponersonido  {0000FF}y agrega tu musica de preferencia..");SetPVarInt(playerid, "Status", 1);

corneta[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
corneta2[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
AttachObjectToVehicle(corneta[vehicleid], GetPlayerVehicleID(playerid) ,0.0, -2.0,0.2,-30.0,-90.0, 0.0);
AttachObjectToVehicle(corneta2[vehicleid], GetPlayerVehicleID(playerid),0.0, -2.0,0.2,-30.0,90.0, 0.0);
luz[4] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
luz[5] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
AttachObjectToVehicle(luz[4], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
AttachObjectToVehicle(luz[5], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 1, 0,0, 0, 1, 0);
PlayerPlaySound(playerid,1058,0,0,0);
}
//==============================================================================
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 559){
SendClientMessage(playerid,rojo, "{00FF00}Bien!! Ahora pon{FF0000} /ponersonido  {0000FF}y agrega tu musica de preferencia..");SetPVarInt(playerid, "Status", 1);
corneta[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
corneta2[vehicleid] = CreateObject(2232,0,0,0,0,0,0);
AttachObjectToVehicle(corneta[vehicleid], GetPlayerVehicleID(playerid) ,0.0, -1.5,0.2,-50.0,-90.0, 0.0);
AttachObjectToVehicle(corneta2[vehicleid], GetPlayerVehicleID(playerid),0.0, -1.5,0.2,-50.0,90.0, 0.0);
luz[4] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
luz[5] = CreateObject(19298,X,Y,Z+3.5,0,0,0);
AttachObjectToVehicle(luz[4], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
AttachObjectToVehicle(luz[5], GetPlayerVehicleID(playerid),X,Y-3,Z, 0.000000, 0.000000, -88.589958);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 1, 0,0, 0, 1, 0);
PlayerPlaySound(playerid,1058,0,0,0);
}
}
else{
nobocina[vehicleid] = 0;
SendClientMessage(playerid,rojo, "{00FF00} Sound-Car Guardado..");
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(corneta[vehicleid]);
DestroyObject(corneta2[vehicleid]);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, 1, 0,0, 0, 0, 0);
}
return 1;
}
return 0;
}
//==============================================================================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

if(dialogid == D_MUSICA)
{
if(response)
{
for(i = 0; i < MAX_PLAYERS; i++)
{
new Float:lX,Float:lY,Float:lZ;
GetPlayerPos(playerid,lX,lY,lZ);
if(PlayerToPoint(40.0,i,lX,lY,lZ))
{
SendClientMessage(i,0xAFFF00C6,"------------------------->{FFED00}Abriendo{0000ff} Sonido {FF0500}Sound-Car{AFFF00}<-------------------------");
PlayAudioStreamForPlayer(i,inputtext);
SendClientMessage(i,0xAFFF00C6,"------------------------->{FFED00}Abriendo{0000ff} Sonido {FF0500}Sound-Car{AFFF00}<-------------------------");
}
}
}
}
return 1;
}
//==============================================================================
public OnVehicleDeath(vehicleid, killerid)
{
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(corneta[vehicleid]);
DestroyObject(corneta2[vehicleid]);

return 1;
}
//==============================================================================
 PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
if(IsPlayerConnected(playerid))
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}
//==============================================================================
public OnPlayerDisconnect(playerid, reason)
{
new vehicleid = GetPlayerVehicleID(playerid);
DestroyObject(luz[4]);
DestroyObject(luz[5]);
DestroyObject(corneta[vehicleid]);
DestroyObject(corneta2[vehicleid]);

return 1;
}


listo espero que les guste es mi primer pos tengo mas de 12 años aprendiendo pawno scripting vice city multiplayer y samp



Attached Images
File Type: jpg sa-mp-000.jpg (153.3 KB)
File Type: jpg sa-mp-017.jpg (140.5 KB)
File Type: jpg sa-mp-018.jpg (165.0 KB)

Viewing all articles
Browse latest Browse all 595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>