-
Hello. Probáltam, létrehozni egy csomagtartó kinyító, és motorháztető parancsot.. de nem müködik valami ötlet?
CMD:mh(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(vehicleid < 47 || vehicleid > 50)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(vInfo[vehicleid][MOTORHAZTETO] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
SendClientMessage(playerid, NARANCS, \"Kinyitottad a motorháztetőt!\");
vInfo[vehicleid][MOTORHAZTETO] = 1;
}
else
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective);
SendClientMessage(playerid, NARANCS, \"Becsuktad a motorháztetőt!\");
vInfo[vehicleid][MOTORHAZTETO] = 0;
}
}
}
}
return 1;
}
CSOMAGTARTÓ
CMD:csominyit(playerid,params[])
{
new vehicleid = Kozelikocsi(playerid);
if(vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][VEHICLE_ID] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][VEHICLE_ID2] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][KVEHICLE_ID] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && AdminSzoliban[playerid] == 1 ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 2 && AdminSzoliban[playerid] == 1)
{
if(vInfo[vehicleid][LOCKED] == 1) cmd_do(playerid, \"A jármű zárva.\");
{
if(vehicleid < 47 || vehicleid > 50)
{
if(vInfo[ vehicleid ][ CSOMAGTARTO ] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
SendClientMessage(playerid, NARANCS, \"Kinyitottad a csomagtartót!\");
vInfo[ vehicleid ][ CSOMAGTARTO ] = 1;
}
else
{
SendClientMessage(playerid, PIROS, \"((Már nyitva van a csomagtartó!))\");
}
}
else
{
SendClientMessage(playerid, PIROS, \"Nincs kulcsod a járműhöz!\");
}
}
}
return 1;
}
-
if(vehicleid < 47 || vehicleid > 50)
ezeket szedd ki szerintem ez a baj tesom
-
két errort dob ki.. Esetleg kódba eltudnád küldeni? Nagyon megköszönném
-
CMD:mh(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(vInfo[vehicleid][MOTORHAZTETO] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
SendClientMessage(playerid, NARANCS, \"Kinyitottad a motorháztetőt!\");
vInfo[vehicleid][MOTORHAZTETO] = 1;
}
else
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective);
SendClientMessage(playerid, NARANCS, \"Becsuktad a motorháztetőt!\");
vInfo[vehicleid][MOTORHAZTETO] = 0;
}
}
}
return 1;
}
CSOMAGTARTÓ
CMD:csominyit(playerid,params[])
{
new vehicleid = Kozelikocsi(playerid);
if(vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][VEHICLE_ID] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][VEHICLE_ID2] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][KVEHICLE_ID] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && AdminSzoliban[playerid] == 1 ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 2 && AdminSzoliban[playerid] == 1)
{
if(vInfo[vehicleid][LOCKED] == 1) cmd_do(playerid, \"A jármű zárva.\");
{
if(vInfo[ vehicleid ][ CSOMAGTARTO ] == 0)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
SendClientMessage(playerid, NARANCS, \"Kinyitottad a csomagtartót!\");
vInfo[ vehicleid ][ CSOMAGTARTO ] = 1;
}
else
{
SendClientMessage(playerid, PIROS, \"((Már nyitva van a csomagtartó!))\");
}
}
else
{
SendClientMessage(playerid, PIROS, \"Nincs kulcsod a járműhöz!\");
}
}
return 1;
}
-
else
{
SendClientMessage(playerid, PIROS, \"Nincs kulcsod a járműhöz!\");
}
}
return 1;
}
Köszönöm hogy segítesz!
Itt ahol van az \"else\" kidob egy errort: \"error 029: invalid expression, assumed zero\" ez mitől lehet?
-
Ott valószínűleg felesleges az egyik }. Szedd ki az egyiket és próbáld meg.
-
Felesleges az egyik kapcsos zárójel.
-
Akkor, elkezd más errorokat kidobálni.. ami nem is oda tartozik
Dupla hozzászólás automatikusan összefûzve. ( 2016. július 24. - 19:42:44 )
motorháztető meg nem is müködik :/
-
CMD:mh(playerid,params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(bonnet == 0)
{
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
SendClientMessage(playerid, NARANCS, \"Kinyitottad a motorháztetőt!\");
vInfo[vehicleid][MOTORHAZTETO] = 1;
}
else
{
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective);
SendClientMessage(playerid, NARANCS, \"Becsuktad a motorháztetőt!\");
vInfo[vehicleid][MOTORHAZTETO] = 0;
}
}
}
return 1;
}
CSOMAGTARTÓ
CMD:csominyit(playerid,params[])
{
new vehicleid = Kozelikocsi(playerid);
if(vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][VEHICLE_ID] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][VEHICLE_ID2] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && pInfo[playerid][KVEHICLE_ID] == GetPlayerVehicleID(playerid) ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 1 && AdminSzoliban[playerid] == 1 ||
vInfo[GetPlayerVehicleID(playerid)][sOLD] == 2 && AdminSzoliban[playerid] == 1)
{
if(vInfo[vehicleid][LOCKED] == 1) cmd_do(playerid, \"A jármű zárva.\");
{
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(boot == 0)
{
SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
SendClientMessage(playerid, NARANCS, \"Kinyitottad a csomagtartót!\");
vInfo[ vehicleid ][ CSOMAGTARTO ] = 1;
}
else
{
SendClientMessage(playerid, PIROS, \"((Már nyitva van a csomagtartó!))\");
}
}
return 1;
}
-
nagyon szépen köszönöm