Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
- #include <a_samp>
- #include <zcmd> //http://forum.sa-mp.com/showthread.php?t=91354
- #include <sscanf2> //http://forum.sa-mp.com/showthread.php?t=120356
- #define MAX_PRESTAMO (100) //Cantidad de prestamos permitidos
- #define MINIMO_PRESTAMO (100) //10 dolares minimo para pedir
- #define MAXIMO_PRESTAMO (5000) //5000 dolares maximo para pedir
- #define VALOR_INTERESES_INICIAL (150) //150 dolares de intereses inicial
- #define TIEMPO_PRESTAMO (20*60000) //tiempo que sumara los intereses, 20 minutos
- new CantidadPrestamo[MAX_PLAYERS],
- bool:PrestamoActivo[MAX_PLAYERS],
- MatarPrestamo[MAX_PLAYERS],
- InteresesPrestamo[MAX_PLAYERS],
- CuotasPrestamo[MAX_PLAYERS],
- DineroPrestamo[MAX_PLAYERS];
- COMMAND:darprestamo(playerid, params[]){
- new data[100], name1[MAX_PLAYER_NAME+1], name2[MAX_PLAYER_NAME+1];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"INFO: Usted no esta autorizado a usar este comando!.");
- if(sscanf(params, "rdd", params[0], params[1], params[2])) return SendClientMessage(playerid,-1,"INFO: Escribe: /darprestamo [id player] [dinero(100-5000)] [cuotas(0-6-12-24)]");
- if(params[0]==INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se id valido!.");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se encuentra conectado!.");
- if(params[0]==playerid) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado es su id, no puedes darte prestamos solo!.");
- if(PrestamoActivo[params[0]]==true) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado ya se encuentra con un prestamo pendiente!.");
- if(CantidadPrestamo[params[0]]>=MAX_PRESTAMO) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado ya ha pedido demasiados prestamos!.");
- if(params[1]<MINIMO_PRESTAMO || params[1]>MAXIMO_PRESTAMO) return SendClientMessage(playerid,-1,"INFO: No ir por debajo de 100, o por arriba de 5000!.");
- if(params[2]==0 || params[2]==6 || params[2]==12 || params[2]==24) return SendClientMessage(playerid,-1,"INFO: Las Cuotas disponibles son de 0-6-12-24!.");
- PrestamoActivo[params[0]]=true;
- KillTimer(MatarPrestamo[params[0]]);
- MatarPrestamo[params[0]]=SetTimerEx("Prestamista", TIEMPO_PRESTAMO, true, "d", params[0]);
- DineroPrestamo[params[0]]=params[1];
- CuotasPrestamo[params[0]]=params[2];
- GivePlayerMoney(params[0], (0+DineroPrestamo[params[0]]));
- PrestamoActivo[params[0]]++;
- GetPlayerName(params[0], name1, sizeof(name1));
- format(data,sizeof(data),"Haz dado un prestamo a %s de: %d, con unos intereses de: %d por cuotas, cuotas a pagar: %d. ",name1, DineroPrestamo[params[0]], VALOR_INTERESES_INICIAL, CuotasPrestamo[params[0]]);
- SendClientMessage(playerid,-1,data);
- GetPlayerName(playerid, name2, sizeof(name2));
- format(data,sizeof(data),"%s Ha dado un prestamo de: %d, con unos intereses de: %d por cuotas, cuotas a pagar: %d. ",name2, DineroPrestamo[params[0]], VALOR_INTERESES_INICIAL, CuotasPrestamo[params[0]]);
- SendClientMessage(params[0],-1,data);
- return true;
- }
- COMMAND:cobrarprestamo(playerid, params[]){
- new data[100], name1[MAX_PLAYER_NAME+1], name2[MAX_PLAYER_NAME+1];
- if(sscanf(params, "rd", params[0], params[1])) return SendClientMessage(playerid,-1,"INFO: Escribe: /cobrarprestamo [id player] [cuotas(0-6-12-24)]");
- if(params[0]==INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se id valido!.");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se encuentra conectado!.");
- if(params[0]==playerid) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado es su id, no puedes cobrarse prestamos solo!.");
- if(PrestamoActivo[params[0]]==false) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se encuentra con un prestamo pendiente!.");
- if(CantidadPrestamo[params[0]]<=0) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no ha pedido ningun prestamos!.");
- if(params[1]==0 || params[1]==6 || params[1]==12 || params[1]==24) return SendClientMessage(playerid,-1,"INFO: Las Cuotas disponibles son de 0-6-12-24!.");
- if(GetPlayerMoney(params[0])>=DineroPrestamo[params[0]]/params[1]) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no tiene esa cantidad de dinero encima!.");
- CuotasPrestamo[params[0]]-=params[1];
- if(CuotasPrestamo[params[0]]<=0){ PrestamoActivo[params[0]]=false; KillTimer(MatarPrestamo[params[0]]); }
- GivePlayerMoney(params[0], (0-DineroPrestamo[params[0]]/CuotasPrestamo[params[0]]+VALOR_INTERESES_INICIAL*InteresesPrestamo[params[0]]));
- GetPlayerName(params[0], name1, sizeof(name1));
- format(data,sizeof(data),"Haz cobrado un prestamo a %s de: %d, con unos intereses de: %d, nuemro de cuota a pagar: %d. ", name1, DineroPrestamo[params[0]]/CuotasPrestamo[params[0]], InteresesPrestamo[params[0]], CuotasPrestamo[params[0]]);
- SendClientMessage(playerid,-1,data);
- GetPlayerName(playerid, name2, sizeof(name2));
- format(data,sizeof(data),"Haz pagado un prestamo a %s de: %d, con unos intereses de: %d, nuemro de cuota a pagar: %d. ", name2, DineroPrestamo[params[0]]/CuotasPrestamo[params[0]], InteresesPrestamo[params[0]], CuotasPrestamo[params[0]]);
- SendClientMessage(params[0],-1,data);
- InteresesPrestamo[params[0]]=0;
- return true;
- }
- COMMAND:resetprestamos(playerid, params[]){
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"INFO: Usted no esta autorizado a usar este comando!.");
- if(sscanf(params, "r", params[0], params[1])) return SendClientMessage(playerid,-1,"INFO: Escribe: /resetprestamos [id player]");
- if(params[0]==INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se id valido!.");
- if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se encuentra conectado!.");
- if(PrestamoActivo[params[0]]==false) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no se encuentra con un prestamo pendiente!.");
- if(PrestamoActivo[params[0]]==true) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado se encuentra con un prestamo pendiente!.");
- if(CantidadPrestamo[params[0]]<=0) return SendClientMessage(playerid,-1,"INFO: El jugador Ingresado no ha pedido ningun prestamos!.");
- CantidadPrestamo[params[0]]=0;
- return true;
- }
- COMMAND:pedirprestamo(playerid, params[]){
- new data[100];
- if(PrestamoActivo[playerid]==true) return SendClientMessage(playerid,-1,"INFO: Usted se encuentra con un prestamo pendiente!.");
- if(CantidadPrestamo[playerid]>=MAX_PRESTAMO) return SendClientMessage(playerid,-1,"INFO: Usted ya ha pedido demasiados prestamos!.");
- if(sscanf(params, "dd", params[0], params[1])) return SendClientMessage(playerid,-1,"INFO: Escribe: /pedirprestamo [dinero(100-5000)] [cuotas(0-6-12-24)]");
- if(params[0]<MINIMO_PRESTAMO || params[0]>MAXIMO_PRESTAMO) return SendClientMessage(playerid,-1,"INFO: No ir por debajo de 100, o por arriba de 5000!.");
- if(params[1]==0 || params[1]==6 || params[1]==12 || params[1]==24) return SendClientMessage(playerid,-1,"INFO: Las Cuotas disponibles son de 0-6-12-24!.");
- PrestamoActivo[playerid]=true;
- KillTimer(MatarPrestamo[playerid]);
- MatarPrestamo[playerid]=SetTimerEx("Prestamista", TIEMPO_PRESTAMO, true, "d", playerid);
- DineroPrestamo[playerid]=params[0];
- CuotasPrestamo[playerid]=params[1];
- GivePlayerMoney(playerid, (0+DineroPrestamo[playerid]));
- PrestamoActivo[playerid]++;
- format(data,sizeof(data),"Has sacado un prestamo de: %d, con unos intereses de: %d por cuotas, cuotas a pagar: %d. ", DineroPrestamo[playerid], VALOR_INTERESES_INICIAL, CuotasPrestamo[playerid]);
- SendClientMessage(playerid,-1,data);
- return true;
- }
- COMMAND:pagarprestamo(playerid, params[]){
- new data[100];
- if(PrestamoActivo[playerid]==false) return SendClientMessage(playerid,-1,"INFO: Usted no se encuentra con un prestamo pendiente!.");
- if(CantidadPrestamo[playerid]>=MAX_PRESTAMO) return SendClientMessage(playerid,-1,"INFO: Usted ya ha pedido demasiados prestamos!.");
- if(sscanf(params, "d", params[0])) return SendClientMessage(playerid,-1,"INFO: Escribe: /pagarprestamo [cuotas(0-6-12-24)]");
- if(params[0]==0 || params[0]==6 || params[0]==12 || params[0]==24) return SendClientMessage(playerid,-1,"INFO: Las Cuotas disponibles son de 0-6-12-24!.");
- if(GetPlayerMoney(playerid)>=DineroPrestamo[playerid]/params[0]) return SendClientMessage(playerid,-1,"INFO: Usted no tiene esa cantidad de dinero encima!.");
- CuotasPrestamo[playerid]-=params[0];
- if(CuotasPrestamo[playerid]<=0){ PrestamoActivo[playerid]=false; KillTimer(MatarPrestamo[playerid]); }
- GivePlayerMoney(playerid, (0-DineroPrestamo[playerid]/CuotasPrestamo[playerid]+VALOR_INTERESES_INICIAL*InteresesPrestamo[playerid]));
- format(data,sizeof(data),"Has pagado el prestamo de: %d, con unos intereses de: %d, nuemro de cuota a pagar: %d. ", DineroPrestamo[playerid]/CuotasPrestamo[playerid], InteresesPrestamo[playerid], CuotasPrestamo[playerid]);
- SendClientMessage(playerid,-1,data);
- InteresesPrestamo[playerid]=0;
- return true;
- }
- forward Prestamista(playerid);
- public Prestamista(playerid){
- new data[100];
- if(PrestamoActivo[playerid]==true){
- InteresesPrestamo[playerid]++;
- format(data,sizeof(data),"se ha aumentado los intereses del prestamos a %d por el retraso.", VALOR_INTERESES_INICIAL*InteresesPrestamo[playerid]);
- SendClientMessage(playerid,-1,data);
- }
- }
- /*
- * ## LEASE ATENTAMENTE PARA NO CONVERTIRSE EN LAMMER!!.: :D ##
- *
- * Estè Simple FILTERSCRIPT esta hecho especialmente para www.forum.sa-mp.com
- * NO Publicar estè FILTERSCRIPT en Otros foros de SA-MP y hacerse pasar por el creador del CODE.
- *
- * Codigo Creado Por OTACON
- *
- * CREDITOS:
- * OTACON: Realizacion y Idea de creacion del code.
- * TÙ: Modificacion libremente respetando lo mencionado ;).
- *
- * NOTA: Menos Creditos para los que me los critican.. JO'PUTAS! :D xD ;)
- *
- * Prohibido TOTALMENTE el Robo de Créditos o la
- * Publicación de este FILTERSCRIPT sin Mi Permiso.
- */
- /*
- * ## READ CAREFULLY TO AVOID BECOMING LAMMER!.: :D ##
- *
- * This simple FILTERSCRIPT is made especially for www.forum.sa-mp.com
- * DO NOT Post the FILTERSCRIPT in Other SAMP forums and impersonating the creator of the CODE.
- *
- * Code Created By OTACON
- *
- * CREDITS:
- * OTACON: Idea Making and code creation.
- * YOUR: Modification freely respecting the above ;).
- *
- * NOTE: Less Credits for those who criticize me.. JO'PUTAS! :D xD ;)
- *
- * FULLY spaces Theft Credit or
- * Publication of this FILTERSCRIPT without my permission.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement