SA-MP Forums Archive
Errors - 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: Errors (/showthread.php?tid=291602)



Errors - Chris_Morrison - 20.10.2011

hello
i just did /car system and i have this errors:
pawn Код:
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13681) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13689) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13689) : warning 215: expression has no effect
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13689) : warning 215: expression has no effect
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13689) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13689) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13689) : fatal error 107: too many error messages on one line
line 13681:
pawn Код:
GetVehicleParamsEx(vehicleid,lights,alarm,doors,bonnet,boot,objective);
line 13689:
pawn Код:
TogVehicleBonnet(vehicleid, 0);



Re: Errors - Stigg - 20.10.2011

line 13681 Should be:
pawn Код:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);//you forgot engine
line 13689 Should be:
pawn Код:
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, true, boot, objective);//toggle bonnet true or false



Re: Errors - Chris_Morrison - 20.10.2011

it's the same lol


Re: Errors - Stigg - 20.10.2011

Your code:
pawn Код:
GetVehicleParamsEx(vehicleid,lights,alarm,doors,bonnet,boot,objective);
TogVehicleBonnet(vehicleid, 0);
My code:
pawn Код:
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);//you forgot engine
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, false, boot, objective);//toggle bonnet true or false
How's it the same ? You forgot engine. Can you read ?

https://sampwiki.blast.hk/wiki/GetVehicleParamsEx
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx


Re: Errors - Chris_Morrison - 20.10.2011

Line 13681 fixed
how do i fix line 13689?


Re: Errors - Stigg - 20.10.2011

pawn Код:
SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, false, boot, objective);//toggle bonnet true or false
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx


Re: Errors - Chris_Morrison - 20.10.2011

You didn't understand me
this is the full code
pawn Код:
else if(strcmp(x_v,"hood",true) == 0)
            {
                GetPlayerName(playerid,sendername,sizeof(sendername));
                new vehicleid = GetPlayerVehicleID(playerid);
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
                {
                    SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle !");
                    return 1;
                }
                if(bonnet == 1)
                {
                    TogVehicleBonnet(vehicleid, 0);
                    format(string, sizeof(string), "* %s closes the vehicle hood.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else
                {
                TogVehicleBonnet(vehicleid, 1);
                    format(string, sizeof(string), "* %s opens the vehicle hood.", sendername);
                    ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                return 1;
            }
Where to add that?


Re: Errors - Stigg - 20.10.2011

Try:
pawn Код:
else if(strcmp(x_v,"hood",true) == 0)
            {
                GetPlayerName(playerid,sendername,sizeof(sendername));
                new vehicleid = GetPlayerVehicleID(playerid);
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
                {
                    SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle !");
                    return 1;
                }
                if(bonnet == 1)
                {
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, false, boot, objective);//toggle bonnet false
                    format(string, sizeof(string), "* %s closes the vehicle hood.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else
                {
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, true, boot, objective);//toggle bonnet true
                    format(string, sizeof(string), "* %s opens the vehicle hood.", sendername);
                    ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                return 1;
            }



Re: Errors - Chris_Morrison - 20.10.2011

Errors
pawn Код:
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13705) : warning 202: number of arguments does not match definition
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13713) : error 012: invalid function call, not a valid address
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13713) : warning 215: expression has no effect
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13713) : warning 215: expression has no effect
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13713) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13713) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator.WINXPSP3\щемзп дтбегд\windows\gamemodes\GRP.pwn(13713) : fatal error 107: too many error messages on one line



Re: Errors - Mr_Scripter - 20.10.2011

try
pawn Код:
else if(strcmp(x_v,"hood",true) == 0)
            {
                GetPlayerName(playerid,sendername,sizeof(sendername));
                new vehicleid = GetPlayerVehicleID(playerid);
                GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
                if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER);
                {
                    SendClientMessage(playerid,COLOR_GREY," You are not even inside a vehicle !");
                    return 1;
                }
                if(bonnet == 1)
                {
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, false, boot, objective);//toggle bonnet false
                    format(string, sizeof(string), "* %s closes the vehicle hood.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else
                {
                    SetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, true, boot, objective);//toggle bonnet true
                    format(string, sizeof(string), "* %s opens the vehicle hood.", sendername);
                    ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                return 1;
            }