When do I return?
#6

Quote:
Originally Posted by $ЂЯĢ
Return when you want function to be ended. You don't need to return values if you don't need them, so doing
Код:
return;
at the end of the function will do the work.
What about in commands?

pawn Код:
if(strcmp(cmd, "/repaircop", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 11 || PlayerInfo[playerid][pLeader] == 11)
            {
                if(IsACopCar(GetPlayerVehicleID(playerid)))
                {
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                    if(IsPlayerInRangeOfPoint(playerid, 50.0, 1568.77,-1692.75,6.98))
                        {
                  RepairVehicle(GetPlayerVehicleID(playerid));
                        SendClientMessage(playerid, COLOR_GREEN, "* Your cruiser ate a donut and is now repaired");

                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GREY,"[Error:] You're not in the garage!");

                        }
                    }
                    else
                    {
                      SendClientMessage(playerid, COLOR_GREY,"[Error:] Only vehicles can be repaired, not brains!");
                    }
                }
                else
                {
                  SendClientMessage(playerid, COLOR_GREY,"[Error:] You're not a cop!");

                }
            }
        }
        return 1;
    }
Is this command properly returned?
Reply


Messages In This Thread
When do I return? - by NiiRV4N4 - 13.06.2010, 07:48
Re: When do I return? - by Kar - 13.06.2010, 07:49
Re: When do I return? - by TheInnocentOne - 13.06.2010, 07:50
Re: When do I return? - by NiiRV4N4 - 13.06.2010, 07:51
Re: When do I return? - by Sergei - 13.06.2010, 07:55
Re: When do I return? - by NiiRV4N4 - 13.06.2010, 08:00
Re: When do I return? - by NiiRV4N4 - 13.06.2010, 08:01
Re: When do I return? - by TheInnocentOne - 13.06.2010, 08:16
Re: When do I return? - by NiiRV4N4 - 13.06.2010, 16:12
Re: When do I return? - by Sergei - 13.06.2010, 16:14

Forum Jump:


Users browsing this thread: 1 Guest(s)