CMD::tr(playerid, params[]) {
#pragma unused params
new
strt[150],
firstcar[50],
secondcar[50],
thirdcar[50]
;
if(uinfo[playerid][Vehicle][0] != -1) {
format(firstcar, sizeof(firstcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][0]), VehicleLockStatus(uinfo[playerid][Vehicle][0]));
} else {
format(firstcar, sizeof(firstcar), "Laisva vieta");
}
if(uinfo[playerid][Vehicle][1] != -1) {
format(secondcar, sizeof(secondcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][1]), VehicleLockStatus(uinfo[playerid][Vehicle][1]));
} else {
format(secondcar, sizeof(secondcar), "Laisva vieta");
}
if(User::ThirdSlot(playerid)) {
if(uinfo[playerid][Vehicle][2] != -1) {
format(thirdcar, sizeof(thirdcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][2]), VehicleLockStatus(uinfo[playerid][Vehicle][2]));
} else {
format(thirdcar, sizeof(thirdcar), "Laisva vieta");
}
} else {
format(thirdcar, sizeof(thirdcar), "Pirkti trečio transporto vietą");
}
format(strt, sizeof(strt), "\
Pavadinimas\tUžraktas\
1. %s\n\
2. %s\n\
3. %s\n",
firstcar, secondcar, thirdcar);
Dialog_Show(playerid, CAR_SELECT, DIALOG_STYLE_TABLIST_HEADERS, "{ff8d00}» {ffffff}Transporto valdymas", strt, "Rinktis", "Išeiti");
return true;
}
Žaidime neveikia ši komanda, serveris reaguoja taip - lyg jos nebūtų, komandų procesorius: Y_CMD. Any solution?
Debuginau, kažkas blogai su formatavimais...
if(uinfo[playerid][Vehicle][0] != -1) {
format(firstcar, sizeof(firstcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][0]), VehicleLockStatus(uinfo[playerid][Vehicle][0]));
} else {
format(firstcar, sizeof(firstcar), "Laisva vieta");
}
if(uinfo[playerid][Vehicle][1] != -1) {
format(secondcar, sizeof(secondcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][1]), VehicleLockStatus(uinfo[playerid][Vehicle][1]));
} else {
format(secondcar, sizeof(secondcar), "Laisva vieta");
}
if(User::ThirdSlot(playerid)) {
if(uinfo[playerid][Vehicle][2] != -1) {
format(thirdcar, sizeof(thirdcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][2]), VehicleLockStatus(uinfo[playerid][Vehicle][2]));
} else {
format(thirdcar, sizeof(thirdcar), "Laisva vieta");
}
} else {
format(thirdcar, sizeof(thirdcar), "Pirkti trečio transporto vietą");
}
Ši tema yra užrakinta!
0
f0cus prieš 9 metus
GetVehName(uinfo[playerid][Vehicle][1])
ar šitoje funkcijoje nereikia naudoti modelio? Ir šiaip, pabandyk debugint ir pažiūrėti kurioje vietoje nustoja veikti.
0
Bičas prieš 9 metus
Function::GetVehName(vehicleid)
{
new strt[40];
format(strt,sizeof(strt),"%s",VehicleNames[GetVehicleModel(vehicleid) - 400]);
return strt;
}
Viskas šioje vietoje gerai, nustoja veikti ties:
if(uinfo[playerid][Vehicle][0] != -1) {
// NUSTOTU VEIKTI TIES ČIA, BET NETURIU PIRMOS TR.
format(firstcar, sizeof(firstcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][0]), VehicleLockStatus(uinfo[playerid][Vehicle][0]));
} else {
format(firstcar, sizeof(firstcar), "Laisva vieta");
}
if(uinfo[playerid][Vehicle][1] != -1) {
// NUSTOJA TIES ČIA
format(secondcar, sizeof(secondcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][1]), VehicleLockStatus(uinfo[playerid][Vehicle][1]));
// NUO ČIA DEBUGAS NIEKO NEBEDARO, TODĖL TURIU PAGRINDO MANYTI KAD KALTAS FORMAT, BET KURIOJE VIETOJE - NEŽINAU.
} else {
format(secondcar, sizeof(secondcar), "Laisva vieta");
}
if(User::ThirdSlot(playerid)) {
if(uinfo[playerid][Vehicle][2] != -1) {
format(thirdcar, sizeof(thirdcar), "%s\t%s", GetVehName(uinfo[playerid][Vehicle][2]), VehicleLockStatus(uinfo[playerid][Vehicle][2]));
} else {
format(thirdcar, sizeof(thirdcar), "Laisva vieta");
}
} else {
format(thirdcar, sizeof(thirdcar), "Pirkti trečio transporto vietą");
}