Why commands dont work?
#4

PHP код:
if (strcmp("/buyrod"cmdtexttrue10) == 0)
{
    
// If the player already has a fishing rod, inform the player and exit the command
    
if (FRod[playerid] == 1)
        return 
SendClientMessage(playerid,0xCD0000FF"You already got Fishing Rod, you may /takerod !");
    
// If the player isn't near a fish market, inform him and exit the command
    
if (!IsPlayerInRangeOfPoint(playerid2387.8272,-1870.7032,7.8359))
        return 
SendClientMessage(playerid,0xCD0000FF"You are not around Fish Market !");
    
// If the player doesn't have enough money to buy a fishing rod, inform him and exit the command
    
if (GetPlayerMoney(playerid) < 400)
        return 
SendClientMessage(playerid,0xCD0000FF"You don't have enough money to buy a fishing rod");
    
// When the player doesn't have a fishing rod yet, is near a fishing market and has enough money, let him buy a fishing rod
    
FRod[playerid] = 1;
    
SendClientMessage(playerid,0xFFFFFFFF"Fishing Rod {88AA88}Bought!");
    
SendClientMessage(playerid,0xFFFFFFFF"/TakeRod to Take it out!");
    
GivePlayerMoney(playerid,-400);

I re-structured your commands a bit, but your mistake was not using "else" for the message "You are not around Fish Market !".
That SendClientMessage was always executed, even if you were in range and even if you had enough money to buy one.
Reply


Messages In This Thread
Why commands dont work? - by dundolina - 19.05.2015, 20:43
Re: Why commands dont work? - by Konstantinos - 19.05.2015, 21:05
Re: Why commands dont work? - by dundolina - 19.05.2015, 21:17
Re: Why commands dont work? - by PowerPC603 - 19.05.2015, 21:21
Re: Why commands dont work? - by dundolina - 19.05.2015, 21:54
Re: Why commands dont work? - by tooMuch - 19.05.2015, 22:10
Re: Why commands dont work? - by dundolina - 19.05.2015, 22:35
Re: Why commands dont work? - by tooMuch - 19.05.2015, 22:38
Re: Why commands dont work? - by dundolina - 19.05.2015, 22:48
Re: Why commands dont work? - by tooMuch - 19.05.2015, 22:55

Forum Jump:


Users browsing this thread: 1 Guest(s)