Getting vehicle ID after a command...:D :D....
#1

I made a command that sets your fishing.
and how do i make the check is he does /gofishing boat
it will check if he is in Dinghy

this is the command

Код:
	if(strcmp(cmd, "/gofishing", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
		        if(gPlayerLogged[playerid] == 0)
				
	            {
	                SendClientMessage(playerid, COLOR_GREY, "    You need to login first ! ");
	                return 1;
	            }
	            new x_fish[256];
				x_fish = strtok(cmdtext, idx);
				if(!strlen(x_fish))
				{
					SendClientMessage(playerid, COLOR_RED, "----------------[Available Fishing]----------------");
					SendClientMessage(playerid, COLOR_GRAD3, "** Boat **");
					SendClientMessage(playerid, COLOR_GRAD3, "** Normal **");
	                SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}USAGE:{FFFFFF} /gofishing [boat/normal]");
					return 1;
				}
				new vehicleid = GetPlayerVehicleID(playerid);
				if(!strcmp(x_fish,"boat",true)) 
				{
				isFishing[playerid] = 1;
				
				}
				else if(!strcmp(x_fish,"normal",true)) 
                {
               
			   
				}
		}//not connected
	    return 1;
	}
Reply
#2

GetVehicleModel(GetPlayerVehicleID(playerid)) tbh
Reply
#3

pawn Код:
if(strcmp(cmd, "/gofishing", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
                if(gPlayerLogged[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "    You need to login first ! ");
                    return 1;
                }
                if(GetVehicleModel(GetPlayerVehicleID(playerid))) == IDBOAT)) //ID BOAT
                {
                    SendClientMessage(playerid, COLOR_GREY, "    You're not in the boat!");
                    return 1;
                }
                new x_fish[256];
                x_fish = strtok(cmdtext, idx);
                if(!strlen(x_fish))
                {
                    SendClientMessage(playerid, COLOR_RED, "----------------[Available Fishing]----------------");
                    SendClientMessage(playerid, COLOR_GRAD3, "** Boat **");
                    SendClientMessage(playerid, COLOR_GRAD3, "** Normal **");
                    SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}USAGE:{FFFFFF} /gofishing [boat/normal]");
                    return 1;
                }
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!strcmp(x_fish,"boat",true))
                {
                isFishing[playerid] = 1;

                }
                else if(!strcmp(x_fish,"normal",true))
                {


                }
        }//not connected
        return 1;
    }
Reply
#4

pawn Код:
if(strcmp(cmd, "/gofishing", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
                if(gPlayerLogged[playerid] == 0)
                {
                    SendClientMessage(playerid, COLOR_GREY, "    You need to login first ! ");
                    return 1;
                }
                if(GetVehicleModel(GetPlayerVehicleID(playerid))) == IDBOAT)) //ID BOAT
                {
                    SendClientMessage(playerid, COLOR_GREY, "    You're not in the boat!");
                    return 1;
                }
                new x_fish[256];
                x_fish = strtok(cmdtext, idx);
                if(!strlen(x_fish))
                {
                    SendClientMessage(playerid, COLOR_RED, "----------------[Available Fishing]----------------");
                    SendClientMessage(playerid, COLOR_GRAD3, "** Boat **");
                    SendClientMessage(playerid, COLOR_GRAD3, "** Normal **");
                    SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}USAGE:{FFFFFF} /gofishing [boat/normal]");
                    return 1;
                }
                new vehicleid = GetPlayerVehicleID(playerid);
                if(!strcmp(x_fish,"boat",true))
                {
                isFishing[playerid] = 1;

                }
                else if(!strcmp(x_fish,"normal",true))
                {


                }
        }//not connected
        return 1;
    }
try this...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)