Cmd not working -
DJRebis - 11.07.2013
Hi, the cmd is liek this:
Код:
if (strcmp("/route", cmdtext, true, 10) == 0)
{
if(IsPlayerInVehicle(playerid, 537))
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
return 1;
}
But when i do it nothing happens! Whats wrong?
Re: Cmd not working -
DJRebis - 11.07.2013
P.S. even when im in that vehicle dialog dosen't appier! ??
Re: Cmd not working -
DJRebis - 11.07.2013
Anyone?
Re: Cmd not working -
Dragonsaurus - 11.07.2013
Isn't 537 the Freight train's ID? The correct usage of IsPlayerInVehicle is like below:
pawn Код:
IsPlayerInVehicle(playerid, vehicleid);
So use it this way:
pawn Код:
if(GetVehicleModel(vehicleid) == 537 && IsPlayerInAnyVehicle(playerid))
Re: Cmd not working -
DJRebis - 11.07.2013
Looks like this now:
Код:
if (strcmp(cmdtext, "/route", true) == 0)
{
if IsPlayerInVehicle(playerid, vehicleid);
if(GetVehicleModel(vehicleid) == 537 && IsPlayerInAnyVehicle(playerid))
{
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
return 1;
}
But 4 errors:
Код:
undefined symbol "vehicleid"
expected token: "*then", but found ";"
empty statement
Without ''if'' infront of IsPlayerInVehicle was 12 errors!!
Re: Cmd not working -
LendaDaMorte - 11.07.2013
Alguйm poderia me ajudar no comando /r ? (rбdio para caminhoneiros em comboio) Game Mode PPC_Trucking!
Obrigado!
px01.carbonhost.com.br:7781
Re: Cmd not working -
DJRebis - 11.07.2013
Quote:
Originally Posted by LendaDaMorte
Alguйm poderia me ajudar no comando /r ? (rбdio para caminhoneiros em comboio) Game Mode PPC_Trucking!
Obrigado!
px01.carbonhost.com.br:7781
|
English,pls??
Re: Cmd not working -
Dragonsaurus - 11.07.2013
pawn Код:
if (strcmp(cmdtext, "/route", true) == 0)
{
if(GetVehicleModel(vehicleid) == 537 && IsPlayerInAnyVehicle(playerid))
{
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
return 1;
}
Take a look at this to understandhow it works:
https://sampwiki.blast.hk/wiki/Function:IsPlayerInVehicle
Vehicleid is not the same as Model ID. Model is the number that is constant for every kind of vehicle, and vehicleid is the id of the vehicle ig-game. e.g, if you have spawned 3 vehicles (no matter what kind of vehicles), the fast vehicle's id is 3 etc.
Re: Cmd not working -
mahdi499 - 11.07.2013
pawn Код:
if (strcmp(cmdtext, "/route", true) == 0)
{
if(IsPlayerInVehicle(playerid))
{
if(GetVehicleModel(vehicleid) == 537)
{
ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel");
return 1;
}
}
}
you understood if wrongfully you can't use If without () and a statment of Then after it.
Re: Cmd not working -
DJRebis - 11.07.2013
Quote:
Originally Posted by mahdi499
pawn Код:
if (strcmp(cmdtext, "/route", true) == 0) { if(IsPlayerInVehicle(playerid)) { if(GetVehicleModel(vehicleid) == 537) { ShowPlayerDialog(playerid,9999,DIALOG_STYLE_LIST,"Routes","Los Santos to San Fierro to Los Santos \nLos Santos to Las Venturas1 to Las Venturas2 to Los Santos \nLos Santos to San Fierro to Las Venturas2 \nLos Santos to Los Santos all stops","OK","Cancel"); return 1; } } }
you understood if wrongfully you can't use If without () and a statment of Then after it.
|
Still 1 error:
Код:
error 017: undefined symbol "vehicleid"