Hallo,Leute Pawo meint das die Line zulang ist (di mit den Auto´s (newcar)) wie kann ich das Problem beheben?
Es sind 48 Auto´s
Script:
if(newcar ==34 || newcar ==35|| newcar ==36 || newcar == 37|| newcar ==38||newcar ==39 || newcar ==40 || newcar ==41 || newcar ==42 || newcar ==43||newcar ==44 || newcar ==45 || newcar ==46 || newcar ==47 || newcar ==48||newcar ==49 || newcar ==50 || newcar ==51 || newcar ==52 || newcar ==53||newcar ==54 || newcar ==55 || newcar ==56 || newcar ==57 || newcar ==58||newcar ==106|| newcar ==107 || newcar ==108 || newcar == 109|| newcar ==110 ||newcar==111 ||newcar ==112 ||newcar ==113||newcar ==114 || newcar ==115|| newcar ==116 || newcar ==117|| newcar ==118||newcar ==119 || newcar ==120|| newcar ==121 || newcar ==122 || newcar ==123||newcar == 124)
{
if(TakingLesson[playerid] == 1) { }
else if(!IsAnInstructor(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Du bist kein Fahrlehrer!");
RemovePlayerFromVehicle(playerid);
}
}
Line zu lang!
- XxReNeXx09
- Geschlossen
- Erledigt
-
-
new Cars[10];
Cars[0] = AddStaticVehicle(.........
Cars[1] = AddStaticVehicle(.........
Cars[2] = AddStaticVehicle(.........
Cars[3] = AddStaticVehicle(.........
Cars[4] = AddStaticVehicle(.........//und so weiter sind dann halt die Carids
if(IsALessonCar(newcar))
{
if(TakingLesson[playerid] == 1) { }
else if(!IsAnInstructor(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Du bist kein Fahrlehrer!");
RemovePlayerFromVehicle(playerid);
}
}irgendwo im Script unten am besten
stock IsALessonCar(carid)
{
for(new i = 0; i<sizeof(Cars); i++)
{
if(Cars[i] == carid)return true;
return false;
}
} -
if(newcar ==34 || newcar ==35|| newcar ==36 || newcar == 37||
newcar ==38||newcar ==39 || newcar ==40 || newcar ==41 || newcar ==42
|| newcar ==43||newcar ==44 || newcar ==45 || newcar ==46 || newcar ==47
|| newcar ==48||newcar ==49 || newcar ==50 || newcar ==51 || newcar ==52
|| newcar ==53||newcar ==54 || newcar ==55 || newcar ==56 || newcar ==57
|| newcar ==58||newcar ==106|| newcar ==107 || newcar ==108 || newcar == 109
|| newcar ==110 ||newcar==111 ||newcar ==112 ||newcar ==113||newcar ==114
|| newcar ==115|| newcar ==116 || newcar ==117|| newcar ==118||newcar ==119
|| newcar ==120|| newcar ==121 || newcar ==122 || newcar ==123||newcar == 124)
{
if(TakingLesson[playerid] == 1) { }
else if(!IsAnInstructor(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Du bist kein Fahrlehrer!");
RemovePlayerFromVehicle(playerid);
}
}oder Möglichkeit 2 ...
new fahrschule[5];
fahrschule[0] = CreateVehicle(...);
fahrschule[1] = CreateVehicle(...);forward bool:FahrschulAuto(playerid);
bool:FahrschulAuto(playerid)
{
new bool:is_id;
for(new i = 0;i<5;i++)
{
if(GetPlayerVehicleID(playerid) == fahrschule[i])
{
is_id = true;
break;
}
}
return is_id;
}if(FahrschulAuto(playerid))
{
if(TakingLesson[playerid] == 1) { }
else if(!IsAnInstructor(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Du bist kein Fahrlehrer!");
RemovePlayerFromVehicle(playerid);
}
} -
ich bin mir nicht sicher,vielleicht so?
#include <a_samp>if(newcar ==34)
{
(newcar ==36)}
(newcar == 37)
(newcar ==38)
(newcar ==39)
(newcar ==40)
(newcar ==41)
(newcar ==42)
(newcar ==43)
(newcar ==44)
(newcar ==45)
(newcar ==46)
(newcar ==47)
(newcar ==48)
(newcar ==49)
(newcar ==50)
(newcar ==51)
(newcar ==52)
(newcar ==53)
(newcar ==54)
(newcar ==55)
(newcar ==56)
(newcar ==57)
(newcar ==58)
(newcar ==106)
(newcar ==107)
(newcar ==108)
(newcar == 109)
(newcar ==110)
(newcar==111)
(newcar ==112)
(newcar ==113)
(newcar ==114)
(newcar ==115)
(newcar ==116)
(newcar ==117)
(newcar ==118)
(newcar ==119)
(newcar ==120)
(newcar ==121)
(newcar ==122)
(newcar ==123)
(newcar == 124)
return 1;
}
{
if(TakingLesson[playerid] == 1) { }
else if(!IsAnInstructor(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Du bist kein Fahrlehrer!");
RemovePlayerFromVehicle(playerid);
}
}Hoffe konnte helfen
-
@ [BFX]∑xþ└øšîøµ wo soll das hin?
forward bool:FahrschulAuto(playerid);
bool:FahrschulAuto(playerid)
{
new bool:is_id;
for(new i = 0;i<5;i++)
{
if(GetPlayerVehicleID(playerid) == fahrschule[i])
{
is_id = true;
break;
}
}
return is_id;
} -
@MAPPER2000: Absoluter Schmarn
XxReNeXx09: Wie ein stock/public behandeln, sprich einfach unten ins Script packen -
Achso ja,wo für steht dort die 5?
new fahrschule[5];