Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: aledark24 on November 03, 2012, 08:13:47 pm

Title: Repair The car in all Pay N spray
Post by: aledark24 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]
 
Title: Re: Repair The car in all Pay N spray
Post by: heekz.shadow 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
Title: Re: Repair The car in all Pay N spray
Post by: stormeus 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)
Title: Re: Repair The car in all Pay N spray
Post by: [KB]ViceMania on December 18, 2012, 03:22:06 pm
Good work, I forgot about that /c reparar :D:D:D:D