Vice City Multiplayer
VC:MP 0.3 => mIRC/pawn Scripting => Topic started 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;
}
-
What about to put GetPlayerMoney?
-
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....
-
This script will never work..
SetTimer( "HealthTimer",5000,1);
-
This script will never work..
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.?
-
Player is healed but not sending ClientMessage when they dont have needed money PLz Fix it.....! i just need help
-
try to set a value for "cash"
new cash = GetPlayerMoney(playerid);
if(cash < 500)
{
blablabla;
}
-
Just remove the fucking timer from your script and it will work like a charm..
-
[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
-
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..
-
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.!
-
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? :)
-
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.
-
it's in that?
-
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]
-
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]
-
If the player has 4990,4991,4992,4993,4994,4995,4996,4997,4998,4999 money, nothing happens.
-
If the player has 4990,4991,4992,4993,4994,4995,4996,4997,4998,4999 money, nothing happens.
now is fine if cash 4999
happy?
-
Thanks alot... i will try this.. Thanks aledark :) i must say thanks for getting what i need :)
-
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]
-
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]
-
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.