Scripting help.
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/heal", cmdtext, true) == 0)
    {
        if(GetPlayerMoney(playerid) < 300)
        {
            SendClientMessage(playerid,YELLOW,"[ERROR]: Not enough money!! This costs $300!");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,YELLOW,"[PLAYER]: Healed for $300!");
            SetPlayerHealth(playerid, 100);
            GivePlayerMoney (playerid, -300);
            return 1;
        }
    }
    if (strcmp("/armour", cmdtext, true) == 0)
    {
        if(GetPlayerMoney(playerid) < 300)
        {
            SendClientMessage(playerid,YELLOW,"[ERROR]: Not enough money!!");
            return 1;
        }
        else
        {
            SendClientMessage(playerid,YELLOW,"[PLAYER]: Armour given for $300!");
            SetPlayerArmour(playerid, 100);
            GivePlayerMoney (playerid, -300);
            return 1;
        }
    }
    if (strcmp("/help", cmdtext, true) == 0)
    {
        SendClientMessage(playerid,YELLOW,"________________________________________________________________________________________");
        SendClientMessage(playerid,YELLOW,"[HELP]: Hello, and welcome to Ultimate Freeroam. This uses a custom script by [UF]Jesco");
        SendClientMessage(playerid,YELLOW,"and was created specifically for his first server; Ultimate Freeroam.");
        SendClientMessage(playerid,YELLOW,"You can use the command: [/commands] to get a list of commands!");
        SendClientMessage(playerid,YELLOW,"________________________________________________________________________________________");
        return 1;
    }
    if (strcmp("/commands", cmdtext, true) == 0)
    {
        SendClientMessage(playerid,YELLOW,"[COMMANDLIST]: /heal; /armour; /register; /login; /admins; /changelog; /report ");
        return 1;
    }
    if (strcmp("/changelog", cmdtext, true) == 0)
    {
        SendClientMessage(playerid,YELLOW,"___________________________________________");
        SendClientMessage(playerid,YELLOW,"Ultimate Freeroam Script Changelog:");
        SendClientMessage(playerid,YELLOW,"< Added a /heal and /armour command. >");
        SendClientMessage(playerid,YELLOW,"< Added admin and login/register system. >");
        SendClientMessage(playerid,YELLOW,"< Added new spawn position. >");
        SendClientMessage(playerid,YELLOW,"____________________________________________");
        return 1;
    }
    return 0;
}
The thing to note is where where i return 1. Compare that to yours and you should see the problem. Also mine is a little more efficient.
Reply


Messages In This Thread
Scripting help. - by [MW2]Jµ§†пс - 26.01.2011, 11:55
Re: Scripting help. - by iggy1 - 26.01.2011, 12:02
Re: Scripting help. - by Mean - 26.01.2011, 12:03
Re: Scripting help. - by [MW2]Jµ§†пс - 26.01.2011, 19:53
Re: Scripting help. - by ricardo178 - 26.01.2011, 19:56

Forum Jump:


Users browsing this thread: 1 Guest(s)