Jump to content
  • 0
Sign in to follow this  
RABIGKY

problema

Question

Salut, am incercat sa fac ca motorul masinii si luminile sa le porneasca player-ul manual...

Quote

1012 public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
1013 {
1014   if(PRESSED(KEY_LOOK_BEHIND))
1015   {
1016        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || GetPVarInt(playerid, "engineDelay") != gettime())
1017       {
1018            cmd_engine(playerid, params[]);
1019            return false;
1020        }
1021    }
1022    if(PRESSED(KEY_ACTION))
1023    {
1024        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || !isPlane(GetPlayerVehicleID(playerid))|| !isBoat(GetPlayerVehicleID(playerid)))
1025        {
1026           cmd_lights(playerid, params[]);
1027            return false;
1028        }
1029    }
1030    if(PRESSED(KEY_ANALOG_DOWN))
1031    {
1032        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || !isPlane(GetPlayerVehicleID(playerid))|| !isBoat(GetPlayerVehicleID(playerid)))
1033       {
1034           new engine, lights, alarm, doors, bonnet, boot, objective;
1035            GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
1036            if(vehicle_boot[GetPlayerVehicleID(playerid)] == true)
1037            {
1038                vehicle_boot[GetPlayerVehicleID(playerid)] = false;
1039                SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_OFF, objective);
1040               return true;
1041           }
1042            vehicle_boot[GetPlayerVehicleID(playerid)] = true;
1043            SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
1044        }
1045    }
1046    if(PRESSED(KEY_ANALOG_UP))
1047    {
1048       if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || !isBike(GetPlayerVehicleID(playerid)) || !isPlane(GetPlayerVehicleID(playerid))|| !isBoat(GetPlayerVehicleID(playerid)))
1049        {
1050            new engine, lights, alarm, doors, bonnet, boot, objective;
1051            GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
1052            if(vehicle_bonnet[GetPlayerVehicleID(playerid)] == true)
1053            {
1054                vehicle_bonnet[GetPlayerVehicleID(playerid)] = false;
1055               SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, VEHICLE_PARAMS_OFF, boot, objective);
1056                return true;
1057            }
1058            vehicle_bonnet[GetPlayerVehicleID(playerid)] = true;
1059            SetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, VEHICLE_PARAMS_ON, boot, objective);
1060        }
1061    }
1062    if (PRESSED(KEY_FIRE))
1063    {
1064        if(PlayerInfo[playerid][pAdmin] >= 5)
1065        {
1066            if (IsPlayerInAnyVehicle(playerid))
1067            {
1068                AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
1069            }
1070            else
1071            {
1072                SCM(playerid, COLOR_RED, "[SERVER]:{FFFFFF} Nu te afli intr-un vehicul!");
1073            }
1074        }
1075        else 
1076            return Admin;
1077    }
1078    return 1;
1079 }

si am primit erorile astea, vreo idee?

Quote

C:\Users\Desktop\gm\gamemodes\gm.pwn(1015) : error 029: invalid expression, assumed zero
C:\Users\Desktop\gm\gamemodes\gm.pwn(1018) : error 017: undefined symbol "params"
C:\Users\Desktop\gm\gamemodes\gm.pwn(1023) : error 029: invalid expression, assumed zero
C:\Users\Desktop\gm\gamemodes\gm.pwn(1026) : error 017: undefined symbol "params"
C:\Users\Desktop\gm\gamemodes\gm.pwn(1031) : error 029: invalid expression, assumed zero
C:\Users\Desktop\gm\gamemodes\gm.pwn(1047) : error 029: invalid expression, assumed zero
C:\Users\Desktop\gm\gamemodes\gm.pwn(1063) : error 029: invalid expression, assumed zero

EDIT: v-am scris nr. randurilor, poate asa va dati seama...

Edited by RABIGKY

GIVE ME A FEW YEARS, I'VE GOT SOME BIG PLANS!

 

I WILL DO ONLY WHAT IS GOOD FOR ME

 

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0
Acum 14 minute, BaFFyJunior a spus:

Pune params in loc de params[]. Cat despre celelalte erori daca nu se rezolva asa o sa ma uit cand intru pe calculator.

Tot ii va da eroare, nici params nu e definit

Va trebui sa pui  " " in loc de params asta daca comenzile respective nu se asteapta sa primeasca anumiti parametri. Daca comenzile au nevoie de parametri (ex: /engine 1 etc) atunci va trebui sa specifici ca si parametru " 1 "

cmd_engine(playerid, " ");

Sau daca coamnda e de forma /engine 1 etc

cmd_engine(playerid, "1");

Se aplica si pentru alte comenzi pe care doresti sa le invoci

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
18 hours ago, Banditul said:

Tot ii va da eroare, nici params nu e definit

Va trebui sa pui  " " in loc de params asta daca comenzile respective nu se asteapta sa primeasca anumiti parametri. Daca comenzile au nevoie de parametri (ex: /engine 1 etc) atunci va trebui sa specifici ca si parametru " 1 "

cmd_engine(playerid, " ");

Sau daca coamnda e de forma /engine 1 etc

cmd_engine(playerid, "1");

Se aplica si pentru alte comenzi pe care doresti sa le invoci

Oke, am rezolvat problema cu "params", mersi :D 

Acum imi apar celelalte erori 1015,1023,1031,1047,1063... Vreo idee?


GIVE ME A FEW YEARS, I'VE GOT SOME BIG PLANS!

 

I WILL DO ONLY WHAT IS GOOD FOR ME

 

 

Share this post


Link to post
Share on other sites
  • 0

Am rezolvat. T/C


GIVE ME A FEW YEARS, I'VE GOT SOME BIG PLANS!

 

I WILL DO ONLY WHAT IS GOOD FOR ME

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

This site uses cookies. By continuing browsing, you agree to the use of this information. For more details, see Terms of Use and Privacy Policy.