Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //============================================================================//
- // //
- // SCRIPT EXCLUSIVO PARA PAWNOSCRIPTING.COM //
- // //
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- // //
- //============================================================================//
- //============================================================================//
- // //
- // CREADO POR <ØTACØN> DESDE 0 //
- // //
- // FECHA DE INICIO DEL SCRIPT 29/01/2012 //
- // ---------------------- //
- // FECHA DE FINALIZACION DEL SCRIPT 29/01/2012 //
- // //
- // PROHIBIDO ROBAR CREDITOS //
- // //
- // ACTUALIZACION 10/02/2012 //
- // //
- // Agregado: Cuando El Vehiculo Explota, //
- // Si tiene Descripcion es Eliminada. //
- // //
- // Agregado: Cuando El Player Sale Del Servidor, //
- // La Descripcion Del Vehiculo Es Eliminada. //
- // //
- //============================================================================//
- //============================================================================//
- // INCLUDEs //
- //============================================================================//
- #include <a_samp>
- //============================================================================//
- // NEWs //
- //============================================================================//
- new
- Str[50],
- Activar_Descripcion[MAX_VEHICLES],
- Text3D:Descripcion[MAX_VEHICLES],
- Death[MAX_VEHICLES]
- ;
- //============================================================================//
- // DEFINESs //
- //============================================================================//
- #define COLOR_VERDE 0x19793AFF
- #define COLOR_BLANCO 0xFFFFFFFF
- #define COLOR_GRIS 0x74777EFF
- #define COLOR_ROSA 0x9516D0FF
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- public OnFilterScriptInit()
- {
- print("\n|---------------------------------------|");
- print("| Filescript por <ØTACØN> |");
- print("| Descripcion Para Vehiculo -- Cargado |");
- print("|-----------------------------------------|\n");
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- public OnFilterScriptExit()
- {
- print("\n|---------------------------------------|");
- print("| Filescript por <ØTACØN> |");
- print("| Descripcion Para Vehiculo -- Cerrado |");
- print("|-----------------------------------------|\n");
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- public OnPlayerConnect(playerid)
- {
- for(new i=0; i<MAX_VEHICLES; i++)
- {
- Death[i] = 0;
- }
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- public OnPlayerDisconnect(playerid, reason)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Death[vehicleid] >= 1)
- {
- Delete3DTextLabel(Descripcion[vehicleid]);
- Activar_Descripcion[vehicleid] = 0;
- Death[vehicleid] = 0;
- }
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- public OnVehicleDeath(vehicleid)
- {
- if(Death[vehicleid] >= 1)
- {
- Delete3DTextLabel(Descripcion[vehicleid]);
- Activar_Descripcion[vehicleid] = 0;
- Death[vehicleid] = 0;
- }
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256], idx;
- cmd = strtok(cmdtext, idx);
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- if (strcmp("/Descripcion", cmd, true) == 0)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_VERDE, " [ ! ] Usted No Se Encuentra En Un Vehiculo.");
- return 1;
- }
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Activar_Descripcion[vehicleid] == 0)
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_VERDE, " [ ! ] Escribe: /Descripcion [Texto]");
- return 1;
- }
- format(Str, sizeof(Str), "- %s -",result);
- Descripcion[vehicleid] = Create3DTextLabel(Str, COLOR_ROSA, 30.0, 40.0, 5.0, 40.0, 1);
- Attach3DTextLabelToVehicle( Descripcion[vehicleid], vehicleid, 0.0, 0.0, 1.2);
- SendClientMessage(playerid, COLOR_GRIS, " [ ! ] Usted Ha Puesto Una Descripcion Al Vehiculo!.");
- SendClientMessage(playerid, COLOR_GRIS, " [ ! ] Escribe: /BorrarDescripcion Para Borrar La Descripcion Actual!.");
- Activar_Descripcion[vehicleid] = 1;
- Death[vehicleid] = 1;
- format(Str, sizeof(Str), " [ - ] La Descripcion Del Vehiculo Dice: %s",result);
- SendClientMessage(playerid, COLOR_BLANCO, Str);
- }
- else
- {
- SendClientMessage(playerid, COLOR_VERDE, " [ ! ] Este Vehiculo Ya Tiene Descripcion, Escribe /BorrarDescripcion .");
- }
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- if (strcmp("/BorrarDescripcion", cmd, true) == 0)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- SendClientMessage(playerid, COLOR_VERDE, " [ ! ] Usted No Se Encuentra En Un Vehiculo.");
- return 1;
- }
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Activar_Descripcion[vehicleid] == 1)
- {
- Delete3DTextLabel(Descripcion[vehicleid]);
- Activar_Descripcion[vehicleid] = 0;
- Death[vehicleid] = 0;
- SendClientMessage(playerid, COLOR_VERDE, " [ ! ] Usted Ha Borrado La Descripcion Del Vehiculo!.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_VERDE, " [ ! ] Este Vehiculo No Tiene Descripcion, Escribe /Descripcion [Texto].");
- }
- return 1;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- return 0;
- }
- //============================================================================//
- // FUNCIONES OTRAS //
- //============================================================================//
- stock strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- //============================================================================//
- // >-- DESCRIPCION PARA VEHICULOS <-- //
- //============================================================================//
- //============================================================================//
- // SI TE SIRVIO RESPETA EL TRABAJO DEL CREADOR //
- // //
- //=========================FINAL DEL FILESCRIPT===============================//
Advertisement
Add Comment
Please, Sign In to add comment