I need help
#1

Nevermind... Removed! ...
Reply
#2

pawn Код:
if(strcmp(cmd, "/heal", true) == 0) {
    if((!IsPlayerInRangeOfPoint(playerid,5.00,1105.5730,-1313.1779,13.2393)) || IsPlayerInRangeOfPoint(playerid,5.00,614.4229,-1773.3818,13.8586)) || IsPlayerInRangeOfPoint(playerid,5.00,2217.0942,-1170.1138,25.3024)) || IsPlayerInRangeOfPoint(playerid,5.00,2049.8718,-2025.0125,13.1116))) return SendClientMessage(playerid, COLOR_RED, "You are not close to the places where you can buy health and armor [The Hearth on the map]");
    SetPlayerHealth(playerid,100);
    SetPlayerArmor(playerid,50);
    SetPlayerCash(playerid,-3500);
    SendClientMessage(playerid,COLOR_GREEN,"You buy 100 Health and 50 Armor for 3500$ !");
Reply
#3

also correct me if I'm wrong but anyone who gets the health would also have their money set to -3500 every time they used it lol.

I'm pretty sure thats not what you intended
Reply
#4

Thanks for trying but there are the same errors
Reply
#5

Код:
if(!IsPlayerInRangeOfPoint(playerid,5.00,1105.5730,-1313.1779,13.2393))
That's one too many closing brackets. Remove it.
Reply
#6

Quote:
Originally Posted by CJay9209
Посмотреть сообщение
also correct me if I'm wrong but anyone who gets the health would also have their money set to -3500 every time they used it lol.

I'm pretty sure thats not what you intended
I know, but im not good scripter im making simple things and i will put a
Код:
new AlreadyHealed[256];
Something like that.



I removed the brackets and now:
Код:
 C:\Users\Ivailo\Desktop\Iordan\Servers\STREET WARS\gamemodes\streetwars.pwn(2491) : error 029: invalid expression, assumed zero
C:\Users\Ivailo\Desktop\Iordan\Servers\STREET WARS\gamemodes\streetwars.pwn(2491) : error 001: expected token: ";", but found "return"
C:\Users\Ivailo\Desktop\Iordan\Servers\STREET WARS\gamemodes\streetwars.pwn(2492) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

Now 1 error:
Код:
C:\Users\Ivailo\Desktop\Iordan\Servers\STREET WARS\gamemodes\streetwars.pwn(2491) : error 001: expected token: ")", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#8

Here you go
pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
{
    if(!IsPlayerInRangeOfPoint(playerid,5.0, 1105.5730,-1313.1779,13.2393) || !IsPlayerInRangeOfPoint(playerid,5.0, 614.4229,-1773.3818,13.8586) ||
    !IsPlayerInRangeOfPoint(playerid,5.0, 2217.0942,-1170.1138,25.3024) || !IsPlayerInRangeOfPoint(playerid,5.0, 2049.8718,-2025.0125,13.1116))
    return SendClientMessage(playerid, COLOR_RED, "You are not close to the places where you can buy health and armor [The Hearth on the map]");
   
    SetPlayerHealth(playerid,100);
    SetPlayerArmor(playerid,50);
    SetPlayerCash(playerid,-3500);
    SendClientMessage(playerid,COLOR_GREEN,"You buy 100 Health and 50 Armor for 3500$ !");
    return 1;
}
Reply
#9

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Here you go
pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
{
    if(!IsPlayerInRangeOfPoint(playerid,5.0, 1105.5730,-1313.1779,13.2393) || !IsPlayerInRangeOfPoint(playerid,5.0, 614.4229,-1773.3818,13.8586) ||
    !IsPlayerInRangeOfPoint(playerid,5.0, 2217.0942,-1170.1138,25.3024) || !IsPlayerInRangeOfPoint(playerid,5.0, 2049.8718,-2025.0125,13.1116))
    return SendClientMessage(playerid, COLOR_RED, "You are not close to the places where you can buy health and armor [The Hearth on the map]");
   
    SetPlayerHealth(playerid,100);
    SetPlayerArmor(playerid,50);
    SetPlayerCash(playerid,-3500);
    SendClientMessage(playerid,COLOR_GREEN,"You buy 100 Health and 50 Armor for 3500$ !");
    return 1;
}
Код:
C:\Users\Ivailo\Desktop\Iordan\Servers\STREET WARS\gamemodes\streetwars.pwn(2494) : error 001: expected token: ")", but found "return"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
It's in the:
pawn Код:
return SendClientMessage(playerid, COLOR_RED, "You are not close to the places where you can buy health and armor [The Hearth on the map]");
Reply
#10

Don't forget to use GivePlayerMoney instead of SetPlayerMoney, if you're just trying to subtract that amount from their money. Using what you are using will set them always to -$3500, no matter if they have $1, or $1,000,000,000,000.

Maybe?:

pawn Код:
if(strcmp(cmd, "/heal", true) == 0)
{
    if(!IsPlayerInRangeOfPoint(playerid,5.0, 1105.5730,-1313.1779,13.2393) || !IsPlayerInRangeOfPoint(playerid,5.0, 614.4229,-1773.3818,13.8586) ||
    !IsPlayerInRangeOfPoint(playerid,5.0, 2217.0942,-1170.1138,25.3024) || !IsPlayerInRangeOfPoint(playerid,5.0, 2049.8718,-2025.0125,13.1116))
    {
    SendClientMessage(playerid, COLOR_RED, "You are not close to the places where you can buy health and armor [The Hearth on the map]");
    }
    else
    {
    SetPlayerHealth(playerid,100);
    SetPlayerArmor(playerid,50);
    GivePlayerMoney(playerid,-3500);
    SendClientMessage(playerid,COLOR_GREEN,"You buy 100 Health and 50 Armor for 3500$ !");
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)