Getting vehicle ID after a command...:D :D.... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting vehicle ID after a command...:D :D.... (
/showthread.php?tid=355403)
Getting vehicle ID after a command...:D :D.... -
PaulDinam - 29.06.2012
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;
}
Re: Getting vehicle ID after a command...:D :D.... -
KingHual - 29.06.2012
GetVehicleModel(GetPlayerVehicleID(playerid)) tbh
Re: Getting vehicle ID after a command...:D :D.... -
WagnerPM - 29.06.2012
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;
}
Re: Getting vehicle ID after a command...:D :D.... -
[A]ndrei - 30.06.2012
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...