Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Rey on December 04, 2012, 01:53:21 pm

Title: Can You Fix !heal cmd i have made it!!?
Post by: Rey on December 04, 2012, 01:53:21 pm
One Error-----------> Unfriend Symbol  >Cost<  in last line (if else)
Can u plz fix it?
[pawn][/pawn]else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
      new Float:Health; GetPlayerHealth( playerid, Health );
      if ( strcmp( GetPlayerLocation( playerid ), "Hospital-Vice-Point-Vice-City-Beach", true ) == 1 ) SendClientMessage( playerid, COLOR_GREEN, "Pm>>>Go To Drug Store For Health." );
        else if ( Health >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "Pm>>>You are healthy." );
        else if ( GetPlayerHandCash( gPlayers[ playerid ] ) < cost ) SendClientMessage( playerid, COLOR_GREEN, "You Don't Have Enough Cash" );
      else
  {
         SetPlayerHealth( playerid, 100.0 );
         DecPlayerHandCash( playerid, 5000 );
         SetTimer( "HealthTimer",5000,1);
            SendClientMessage( playerid, COLOR_GREEN, "Successfully Healed." );
      }
      return 1;
      }
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: NeskWriter on December 04, 2012, 03:22:18 pm
What about to put GetPlayerMoney?
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Rey on December 04, 2012, 03:24:59 pm
In my cmd [Symbol] it is DecPlayerHandCash u can see it i dont know if i have placed it at wrong place but working if u have 5000 cash....
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Fuzzy168 on December 05, 2012, 05:17:29 am
This script will never work..

Quote from: Rey
SetTimer( "HealthTimer",5000,1);
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Rey on December 05, 2012, 12:53:17 pm
This script will never work..

Quote from: Rey
SetTimer( "HealthTimer",5000,1);
Okey i know this but one day it will and i wanted to fix last line of [if else] if u can do it.?
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Rey on December 15, 2012, 12:29:19 pm
Player is healed but not sending ClientMessage when they dont have needed money PLz Fix it.....! i just need help
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: NeskWriter on December 15, 2012, 12:35:41 pm
try to set a value for "cash"

new cash = GetPlayerMoney(playerid);
if(cash < 500)
{
    blablabla;
}
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Fuzzy168 on December 16, 2012, 06:07:26 pm
Just remove the fucking timer from your script and it will work like a charm..
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: mrockxkingbutt on December 16, 2012, 06:18:39 pm
[pawn]else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
      new Float:Health; GetPlayerHealth( playerid, Health );
      if ( strcmp( GetPlayerLocation( playerid ), "Hospital-Vice-Point-Vice-City-Beach", false ) == 0 ) SendClientMessage( playerid, COLOR_GREEN, "You have to be at the hospital." );
        else if ( Health >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "Error: You are healthy." );
      else
      {
         SetPlayerHealth( playerid, 100.0 );
            SendClientMessage( playerid, COLOR_GREEN, "You have been healed." );
      }
      return 1;
   }[/pawn]
use this i am using this
this is good to heal
no money cost
healed in 0 sec
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Fuzzy168 on December 17, 2012, 04:54:10 am
use this i am using this
this is good to heal
no money cost
healed in 0 sec
Yep this or you could use stormeus way of timer which is much complicating than it seems..
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Rey on December 17, 2012, 09:18:52 pm
Just remove the fucking timer from your script and it will work like a charm..

Cool Down, you need to Fix needed Script, and Timer has to work and will work....Thanks by the way.!
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: BadCivil on December 18, 2012, 12:42:31 am
mrockxkingbutt in your system is a error:

C:\Documents and Settings\XPPRESP3\Desktop\[MBF]Szerver\gamemodes\mode.pwn(648) : error 017: undefined symbol "GetPlayerLocation"

WHAT IS THE PROBLEM? :)
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: sseebbyy on December 18, 2012, 12:47:56 am
mrockxkingbutt in your system is a error:

C:\Documents and Settings\XPPRESP3\Desktop\[MBF]Szerver\gamemodes\mode.pwn(648) : error 017: undefined symbol "GetPlayerLocation"

WHAT IS THE PROBLEM? :)

You need "GetPlayerLocation" function.
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: BadCivil on December 18, 2012, 12:49:21 am
it's in that?
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Fuzzy168 on December 18, 2012, 06:22:31 am
it's in that?
mrockxkingbutt uses GUPS.. If your not using GUPS, remove this line:
[pawn]if ( strcmp( GetPlayerLocation( playerid ), "Hospital-Vice-Point-Vice-City-Beach", false ) == 0 ) SendClientMessage( playerid, COLOR_GREEN, "You have to be at the hospital." );[/pawn]
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: aledark24 on December 19, 2012, 06:37:09 pm
Ok i give to you the command :p

 [pawn]  else if(strcmp(cmdtext, "health", true) == 0) {
       if(PlayerToPoint(30, playerid,-819.74688, 1135.71984, 12.28209) || PlayerToPoint(25, playerid,-117.97110, -978.80822, 10.71902) || PlayerToPoint(8, playerid,-851.71875, -78.65664, 11.55582)){
           new Dinero = GetPlayerMoney(playerid);
             if(Dinero >= 5000) {
           SendClientMessage(playerid,COLOR_YELLOW,"You are healthy");
           SetPlayerMoney(playerid,GetPlayerMoney(playerid) - 5000);
                DecPlayerHandCash(playerid,5000);
          
          }
           if(Dinero < 4999) {
           SendClientMessage(playerid,COLOR_YELLOW,"Need more money to health,  you need $ 5000");
           }
         }
           else
           {
           SendClientMessage(playerid,COLOR_YELLOW,"Need to be in any hospital or the drugs store");
           }
       return 1;
   }  [/pawn]
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: heekz.shadow on December 21, 2012, 11:06:03 am
If the player has 4990,4991,4992,4993,4994,4995,4996,4997,4998,4999 money, nothing happens.
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: aledark24 on December 21, 2012, 05:32:58 pm
If the player has 4990,4991,4992,4993,4994,4995,4996,4997,4998,4999 money, nothing happens.
now is fine if cash 4999
happy?
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Rey on December 28, 2012, 12:25:30 am
Thanks alot... i will try this.. Thanks aledark :) i must say thanks for getting what i need :)
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: shaheersa on February 08, 2013, 08:13:34 am
I saw the error, just copy this script and it will be fixed
One Error-----------> Unfriend Symbol  >Cost<  in last line (if else)
Can u plz fix it?
[pawn]else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
      new Float:Health; GetPlayerHealth( playerid, Health );
      if ( strcmp( GetPlayerLocation( playerid ), "Hospital-Vice-Point-Vice-City-Beach", true ) == 1 ) SendClientMessage( playerid, COLOR_GREEN, "Pm>>>Go To Drug Store For Health." );
        else if ( Health >= 100 ) SendClientMessage( playerid, COLOR_GREEN, "Pm>>>You are healthy." );
        else if ( GetPlayerHandCash( gPlayers[ playerid ] ) < 5000 ) SendClientMessage( playerid, COLOR_GREEN, "You Don't Have Enough Cash" );//The error was here
      else
  {
         SetPlayerHealth( playerid, 100.0 );
         DecPlayerHandCash( playerid, 5000 );
         SetTimer( "HealthTimer",5000,1);
            SendClientMessage( playerid, COLOR_GREEN, "Successfully Healed." );
      }
      return 1;
      }
[/pawn]
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: mrockxkingbutt on February 08, 2013, 03:14:45 pm
begin
[pawn]new Medic[MAX_PLAYERS];[/pawn]
cmd
[pawn]    else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
      new Float:Health; GetPlayerHealth( playerid, Health );
        if ( Health >= 100 ) SendClientMessage( playerid, COLOR_YELLOW, ">> Error: You are healthy." );
      else
      {
     if(CheckMoney(playerid, 500))
             {
          TogglePlayerControllable(playerid,0);
          SetTimer("healing", 5000, false);
          DecPlayerHandCash(playerid,200);
          GameTextForPlayer(playerid, "Healing");
      Medic[playerid] = 1;
      }
      }
      return 1;
      }[/pawn]
stock
[pawn]public healing() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(Medic == 1) {
TogglePlayerControllable(i, 1);
SetPlayerHealth( i, 100.0 );
SendClientMessage( i, COLOR_YELLOW, ">> You have been healed!" );
             }
           }
         }
       }[/pawn]
public
[pawn]stock CheckMoney(playerid, money)
{
     if(IsPlayerConnected(playerid))
     {
    new b[64];
    new xx;
    xx = money - (GetPlayerMoney(playerid));
    if(GetPlayerMoney(playerid) >= money)
    {
    return 1;
    }
    else
    {
    format(b,sizeof(b)," You do not have enough money! left %d$",xx);
    SendClientMessage(playerid, RED, b);
    return 0;
    }
  }
      return 0;
}[/pawn]
Title: Re: Can You Fix !heal cmd i have made it!!?
Post by: Fuzzy168 on February 10, 2013, 06:29:43 am
I still doubt your script will work like it should be... Although it solves the player ID part, it still won't solve the timing part. I wanted to explain to you what will happen when your script is in action, but I don't have much time.