Command not recognised? Don't see the issue? - 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: Command not recognised? Don't see the issue? (
/showthread.php?tid=501354)
Command not recognised? Don't see the issue? -
Dokins - 17.03.2014
pawn Код:
CMD:myvehicles(playerid, params[])//NEEDS REWRITE
{
new string[512];
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
for(new v= 1;v<MAX_VEHICLES;v++)
{
if(VehOwner[v] == PlayerSQLID[playerid])
{
new name1 = GetVehicleModel(VehModel[v]) - 400;
format(string, sizeof(string), "%s%s - ID(%d) - Plate: {33AA33}%s\n",string, VehicleNames[name1], v, VehPlate[v]);
}
}
ShowPlayerDialog(playerid,DIALOG_SHOWCAR,DIALOG_STYLE_MSGBOX,"My Vehicles", string,"Close","");
return 1;
}
Could anyone tell me why this isn't working?
Re: Command not recognised? Don't see the issue? -
Jefff - 17.03.2014
VehModel[v] is
new Veh_ID = CreateVehicle(...
VehModel[Veh_ID] = Veh_ID; // or model?
?
maybe should be
new name1 = VehModel[v] - 400;
Re: Command not recognised? Don't see the issue? -
Dokins - 17.03.2014
Oh yeah, Stupid mistake. Thank you, However, the loop seems to stop at the first vehicle it finds that's a match and doesn't continue? could you tell me why?
EDIT: FIXED. THANK YOU!
Re: Command not recognised? Don't see the issue? -
Jefff - 17.03.2014
Problem is in VehOwner or VehPlate, use this
https://sampforum.blast.hk/showthread.php?tid=262796 and it will print where is the problem
Re: Command not recognised? Don't see the issue? -
CuervO - 17.03.2014
Also, max vehicles should be looped with a less or equal to (
<=) since the limit includes MAX_VEHICLES