Author Topic: Repair The car in all Pay N spray  (Read 3608 times)

0 Members and 1 Guest are viewing this topic.

Offline aledark24

  • Made Man
  • ***
  • Posts: 206
  • I am a scripter and you have celous of me....so you crashed my servers
    • View Profile
Repair The car in all Pay N spray
« on: November 03, 2012, 08:13:47 pm »
Modificated 17-11-12


This commands is for Warchief          



[pawn]        /*Comando para reparar vehiculo en Pay N spray */
           else if(strcmp(cmdtext, "reparar", true) == 0) {
       if(PlayerToPoint(6, playerid,-870.66674, -118.24742, 10.65336 ) || PlayerToPoint(6, playerid,-912.51165, -1268.10986, 11.86920) || PlayerToPoint(6, playerid,-11.25934, -1258.25854, 10.23682) || PlayerToPoint(6, playerid,327.91986, 430.80700, 11.16345)) {


           new cash = GetPlayerMoney(playerid);
             if(cash >= 500) {
           SendClientMessage(playerid,COLOR_YELLOW,"Has reparado tu vehiculo");
           SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
          SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
           DecPlayerCash(playerid,500);
          }
           if(cash < 499) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $500 para reparar el vehiculo!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Solo se repara en Pay N Spray");
           }
       return 1;
   } [/pawn]

This commands is for another script

[pawn] else if(strcmp(cmdtext, "reparar", true) == 0) {
       if(PlayerToPoint(6, playerid,-870.66674, -118.24742, 10.65336 ) || PlayerToPoint(6, playerid,-912.51165, -1268.10986, 11.86920) || PlayerToPoint(6, playerid,-11.25934, -1258.25854, 10.23682) || PlayerToPoint(6, playerid,327.91986, 430.80700, 11.16345)) {


           new cash = GetPlayerMoney(playerid);
             if(cash >= 500) {
           SendClientMessage(playerid,COLOR_YELLOW,"Has reparado tu vehiculo");
           SetVehicleTyre(GetPlayerVehicleID(playerid), 1);
          SetVehicleHealth(GetPlayerVehicleID(playerid),1000);
           DecPlayerHandCash(playerid,500);
          }
           if(cash < 499) {
           SendClientMessage(playerid,COLOR_YELLOW,"Necesitas mas dinero!Necesitas $500 para reparar el vehiculo!");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Solo se repara en Pay N Spray");
           }
       return 1;
   }  [/pawn]


this is the public

[pawn] //==============================================================================
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    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;
}
//============================================================================== [/pawn]
 
« Last Edit: November 17, 2012, 06:08:54 pm by aledark24 »
I am a great scripter and you are celous of my works
.....

Vice City Life Multiplayer By Saint

Offline heekz.shadow

  • LU testers
  • Made Man
  • *
  • Posts: 249
    • View Profile
Re: Repair The car in all Pay N spray
« Reply #1 on: November 04, 2012, 12:05:21 pm »
Nice copy!

also,
Code: [Select]
GetPlayerCash(playerid),500-GetPlayerCash(playerid)); the fuck?



Example: Player A has $1000.
> 500-GetPlayerCash(playerid)
> Money: $1000, Needed -$500

dafaq
Code: [Select]
[20:23] <habi> later only i heard that lu chatbox is customizable. On my first visit, it appeared ugly.
[20:23] <habi> May be that also be the reason why lu has no players

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Repair The car in all Pay N spray
« Reply #2 on: November 11, 2012, 03:11:20 am »
PORQUE SIEMPRE CRÍTICAS TODO??,SÍ NO TE GUSTA LOS COMANDOS QUE HAGO MEJOR NO VEAS MIS POST Y ANDA A JUGAR CON TUS BARBIES

Calm down and do not flame other people. He pointed out a bug in your script. The script is giving players free car repairs because of an error in the math you're using. You need to use:

GetPlayerCash(playerid) - 500


And not:

500 - GetPlayerCash(playerid)
Do not PM me for support.




Offline [KB]ViceMania

  • Wiseguy
  • **
  • Posts: 53
  • Mega War server administrator
    • View Profile
Re: Repair The car in all Pay N spray
« Reply #3 on: December 18, 2012, 03:22:06 pm »
Good work, I forgot about that /c reparar :D:D:D:D