Need help
#2

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerInAnyVehicle(playerid))
I wouldn't recommend you putting the If(IsPlayerInAnyVehicle) under the Command text public, rather put it in the command that you want. IE:

Код:
else if(strcmp(cmdtext, "/anos", true)==0)
{
    if(IsPlayerInAnyVehicle(playerid))
        {

            AddVehicleComponent(GetPlayerVehicleID(playerid),1010);

            PlayerPlaySound(playerid,1133,0.0,0.0,0.0);

            SendClientMessage(playerid,blue,"Nos Added");

            return 1;

        }
and if you are too lazy to type, you can always make it a variable like so:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new checkforcar = IsPlayerInAnyVehicle(playerid);
and then for your commands
Код:
else if(strcmp(cmdtext, "/anos", true)==0)
{
    if(checkforcar)
        {

            AddVehicleComponent(GetPlayerVehicleID(playerid),1010);

            PlayerPlaySound(playerid,1133,0.0,0.0,0.0);

            SendClientMessage(playerid,blue,"Nos Added");

            return 1;

        }
It may solve you're problem, but I can't say for sure since I didn't test it, but I hope it does, good luck, message me for further assistance.
Reply


Messages In This Thread
Need help - by Bodo4you - 09.05.2009, 11:04
Re: Need help - by Paladin - 09.05.2009, 12:06
Re: Need help - by Bodo4you - 09.05.2009, 13:15

Forum Jump:


Users browsing this thread: 1 Guest(s)