SA-MP Forums Archive
command help please. - 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 help please. (/showthread.php?tid=456699)



command help please. - eastern - 07.08.2013

i made this cmd from scratch but i got 4errors said invalid expression or something like that what the proplem please help for that.
pawn Код:
CMD:vstorage(playerid, params[])
{
             for(new i; i < MAX_PLAYERVEHICLES; i++)
             {
               if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
               {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);
                 LoadPlayerVehicles(playerid, pvId);(error)
                 return 1;
               }
               if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
               {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);
                 UnloadPlayerVehicles(playerid, pvId);(error)
                 return 1;
              }
              else
              {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
              }
              new vstring[1024];
              ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "OnStar Vehicle Storage", vstring, "(De)Spawn", "Cancel");(error)
              return 1;

this is error lines
pawn Код:
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95083) : warning 202: number of arguments does not match definition
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95090) : warning 202: number of arguments does not match definition
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : error 029: invalid expression, assumed zero
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : error 001: expected token: ";", but found ")"
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : error 029: invalid expression, assumed zero
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95099) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.



Re: command help please. - PrinceKumar - 07.08.2013

show your error line and error


Re: command help please. - Edix - 07.08.2013

Can you please show the exact lines it shows those errors?


Re: command help please. - Max5 - 07.08.2013

Код:
 ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "OnStar Vehicle Storage", vstring, "(De)Spawn", "Cancel");
Dat line


Re: command help please. - PrinceKumar - 07.08.2013

for(new i=0; i<MAX_PLAYERVEHICLES; i++) use it


Re: command help please. - eastern - 07.08.2013

yeah this is it


Re: command help please. - Edix - 07.08.2013

Quote:
Originally Posted by PrinceKumar
Посмотреть сообщение
for(new i=0; i<MAX_PLAYERVEHICLES; i++) use it
it doesnt matter if he declares that i = 0 or not.

I dont think theres a reason for you to use a 1024 size string, lower it down to 128 see if that helps a bit.


Re: command help please. - eastern - 07.08.2013

i wrote error next to error lines


Re: command help please. - Edix - 07.08.2013

pawn Код:
CMD:vstorage(playerid, params[])
{
             for(new i; i < MAX_PLAYERVEHICLES; i++)
             {
               if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
               {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);
                 LoadPlayerVehicles(playerid, pvId);(error)
                 return 1;
               }
               if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
               {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);
                 UnloadPlayerVehicles(playerid, pvId);(error)
                 return 1;
               }
               else
               {
                  new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
               }
              }
              //new vstring[1024];
              ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "OnStar Vehicle Storage", vstring, "(De)Spawn", "Cancel");
}
              return 1;
}

try using this.


Re: command help please. - eastern - 07.08.2013

Quote:
Originally Posted by Edix
Посмотреть сообщение
pawn Код:
CMD:vstorage(playerid, params[])
{
             for(new i; i < MAX_PLAYERVEHICLES; i++)
             {
               if(PlayerVehicleInfo[playerid][i][pvId] > INVALID_PLAYER_VEHICLE_ID)
               {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\n%s", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);
                 LoadPlayerVehicles(playerid, pvId);(error)
                 return 1;
               }
               if(PlayerVehicleInfo[playerid][i][pvImpounded] == 1)
               {
                 new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\n%s (impounded)", vstring, VehicleName[PlayerVehicleInfo[playerid][i][pvModelId] - 400]);
                 UnloadPlayerVehicles(playerid, pvId);(error)
                 return 1;
               }
               else
               {
                  new vstring[1024];
                 format(vstring, sizeof(vstring), "%s\nEmpty", vstring);
               }
              }
              //new vstring[1024];
              ShowPlayerDialog(playerid, VSTORAGE, DIALOG_STYLE_LIST, "OnStar Vehicle Storage", vstring, "(De)Spawn", "Cancel");(error)
}
              return 1;
}

try using this.
pawn Код:
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95083) : warning 202: number of arguments does not match definition
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95090) : warning 202: number of arguments does not match definition
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95100) : error 029: invalid expression, assumed zero
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95100) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95100) : warning 215: expression has no effect
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95100) : error 017: undefined symbol "vstring"
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95100) : error 029: invalid expression, assumed zero
F:\San Andreas\latest server job\h\h\gamemodes\VGRP.pwn(95100) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.