SA-MP Forums Archive
Need a bit help with this error - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need a bit help with this error (/showthread.php?tid=182409)



Need a bit help with this error - NoobScripter1 - 10.10.2010

I made one code to park vehicle and despawn at same time.. And now i finished.. the code to spawn it again but im getting one error here is my code to spawn
pawn Код:
else if(strcmp(x_v,"get1",true) == 0)
            {
                if(IsPlayerConnected(playerid))
                 {
                     if(Account[playerid][pPcarkey1] == 999 && Account[playerid][pPcarkey2] == 999 && Account[playerid][pPcarkey3] == 999)
                    {
                        SendClientMessage(playerid,COLOR_LIGHTRED,"ERROR: You do not own a car!");
                        return true;
                    }
                     new carkey1 = Account[playerid][pPcarkey1];
                    GetPlayerName(playerid, playername, sizeof(playername));
                    if(IsPlayerInVehicle(playerid, carkey1))
                    {
                        SendClientMessage(playerid,COLOR_LIGHTRED,"ERROR: You are in your car...");
                        return true;
                    }
                    {
                            CreateVehicle(carkey1, VehicleInfo[carkey1][cLocationx], VehicleInfo[carkey1][cLocationy], VehicleInfo[carkey1][cLocationz]);
                            TextDrawSetString(Textdrawz[playerid],"~w~Info: Your car its parked at same place where you parked it.");
                            TextDrawShowForPlayer(playerid,Textdrawz[playerid]);
                            NoText[playerid]=5;
                            OnPlayerUpdate(playerid);
                            return true;
                       }
                }
            }
Quote:

ERROR:number of arguments does not match definition

EDIT: the error line its at "CreateVehicle"


Re: Need a bit help with this error - DarrenReeder - 10.10.2010

serach for "CreateVehicle" on samp wiki and then you will have your answer..


(Arguemnts is each parameter)


Re: Need a bit help with this error - NoobScripter1 - 10.10.2010

Alright but how can i fix it? i need to load the location of the car


Re: Need a bit help with this error - ACERS - 10.10.2010

You are missing parameters.
https://sampwiki.blast.hk/wiki/CreateVehicle

pawn Код:
(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)
You got: Modelid, X, Y, Z.
So basically you will need Angle, Color1, Color2, Respawn_Delay.

For further information what each parameter does read the Wiki however I believe it's really easy to understand what each parameter means.

Edit:
pawn Код:
CreateVehicle(carkey1, VehicleInfo[carkey1][cLocationx], VehicleInfo[carkey1][cLocationy], VehicleInfo[carkey1][cLocationz], Angle, Color1, Color2, Respawn_Delay);
So basically you could copy the above line, And change the parameters I added to your needs and that should fix the problem.(Angle, Color1, Color2, Respawn_Delay)


Re: Need a bit help with this error - DarrenReeder - 10.10.2010

CreateVehicle(carkey1, VehicleInfo[carkey1][cLocationx], VehicleInfo[carkey1][cLocationy], VehicleInfo[carkey1][cLocationz], 0, -1, -1, 60000);

You need to give the car's angle, 2 colors nad the respawn time.. that will get rid of errors, but the car will be spawned with a strange angle..


Re: Need a bit help with this error - NoobScripter1 - 10.10.2010

Oh lol i added the angle from the vehicle info enum and it compiled just need test Thank you