Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Sistema de Camioneros Creado por Badyx */
- /* Includes */
- #include <a_samp>
- /* Notas
- La variable EstaEnCamion la dejo desactivada ya que yo no puedo saber que
- que ids tienes en tu gm. Tampoco hago que se creen los camiones por que
- correria las ids. Si lo necesitan activenlo. */
- /* Enums */
- new Float:gGarbagePoints[4][3] = {
- {2003.3517,-1730.5336,13.1080},
- {2243.8682,-1895.1603,13.1057},
- {2872.5264,-1507.8936,10.5887},
- {2083.6062,-1843.3563,13.1080}
- };
- /* News */
- new EstaDeRuta[MAX_PLAYERS];
- /* Forwards */
- //forward EstaEnCamion(carid);
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- /* Colores */
- #define COLOR_GREY 0xAFAFAFAA
- #if defined FILTERSCRIPT
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Sistema de camioneros by Badyx");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- EstaDeRuta[playerid] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- EstaDeRuta[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- //new newcar = GetPlayerVehicleID(playerid);
- if (strcmp("/Ruta", cmdtext, true, 10) == 0)
- {
- //if(EstaEnCamion(newcar)) return SendClientMessage(playerid, COLOR_GREY, "No estas en un camion.");
- if(EstaDeRuta[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "Ya estas en una ruta.");
- if(PlayerToPoint(70.0, playerid, 2468.4919,-2092.9902,13.5469))
- {
- new Rutas;
- Rutas = random(sizeof(gGarbagePoints));
- SetPlayerCheckpoint(playerid, gGarbagePoints[Rutas][0], gGarbagePoints[Rutas][1], gGarbagePoints[Rutas][2], 5.0);
- SendClientMessage(playerid, COLOR_GREY, "Tu destino fue marcado en tu gps.");
- EstaDeRuta[playerid] = 1;
- return 1;
- }
- else SendClientMessage(playerid, COLOR_GREY, "No estas en el almacén.");
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(EstaDeRuta[playerid] == 1)
- {
- new string[128], Cantidad = random(100);
- PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~w~Te pagaron~n~~g~$%d",Cantidad);
- GameTextForPlayer(playerid, string, 5000, 1);
- GivePlayerMoney(playerid, Cantidad);
- }
- return 1;
- }
- public 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 EstaEnCamion(carid)
- {
- if((carid >= ID-Desde && carid <= ID-Hasta))
- {
- return 1;
- }
- return 0;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment