Započeo armstrongs
•11. Sep. 2023.[Pomoc] sscanf
525
pregleda
8
postova
Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
28
Postovi:
9
Teme:
Pridružio se:Feb. 2022
11. Sep. 2023.
Pitanje/Savjet:
[22:26:22] sscanf warning: Format specifier does not match parameter count.
[22:26:29] sscanf warning: Format specifier does not match parameter count.
[22:32:17] sscanf warning: Format specifier does not match parameter count.
Izbacuje mi ovo u server.log sta bi moglo da bude?
[22:26:22] sscanf warning: Format specifier does not match parameter count.
[22:26:29] sscanf warning: Format specifier does not match parameter count.
[22:32:17] sscanf warning: Format specifier does not match parameter count.
Izbacuje mi ovo u server.log sta bi moglo da bude?
Made Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
368
Postovi:
31
Teme:
Pridružio se:Dec. 2018
12. Sep. 2023.
https://github.com/y-less/sscanf/blob/master/README.md#sscanf-warning-format-specifier-does-not-match-parameter-count
Također "apdejtuj" sscanf.
Također "apdejtuj" sscanf.
Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
28
Postovi:
9
Teme:
Pridružio se:Feb. 2022
13. Sep. 2023.
Nije do updata sscanfa, nasao sam koji je problem.. Problem je u komandama
Komande su:
/afv - da popravis nekom igracu vozilo
/flipcar - da vratis auto nekom u prvobitno stanje
Aj ko zna neka pogleda i neka kaze u cemu je problem tu
Komande su:
/afv - da popravis nekom igracu vozilo
/flipcar - da vratis auto nekom u prvobitno stanje
CMD:flipcar(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1 || PlayerInfo >= 1)
{
new id;
if(sscanf(params, "rs", id)) return KORISTIMES(playerid, "/flipcar [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new Float:A, vehicleid = GetPlayerVehicleID(id);
if(!IsPlayerInAnyVehicle(id)) return GRESKAMES(playerid, "Igrac nije u vozilo");
GetVehicleZAngle(vehicleid, A);
SetVehicleZAngle(vehicleid, A);
INFOMES(playerid, "{FF8C00}[FLIP CAR] | {FFFFFF}Flipovali ste auto igracu.");
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu.");
return 1;
}CMD:afv(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1)
{
new id;
if(sscanf(params, "fv", id)) return KORISTIMES(playerid, "/afv [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new string;
RepairVehicle(GetPlayerVehicleID(id));
SetVehicleHealth(GetPlayerVehicleID(id), 999.0);
INFOMES(playerid, "Go popravivte voziloto.");
format(string, sizeof(string), "{FF8C00} | {FFFFFF} %s[%d] je popravio vozilo igracu %s[%d]", GetName(playerid), playerid, GetName(id), id);
ABroadCast(COLOR_WHITE, string, 1);
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu");
return 1;
}Aj ko zna neka pogleda i neka kaze u cemu je problem tu
Underboss
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
7 / 250 XP
Početnik(0)
535
Postovi:
50
Teme:
Pridružio se:Nov. 2013
13. Sep. 2023.
if(sscanf(params, "rs", id))
Šta bi tebi točno trebalo označavati rs?
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
Ispravljene komande:
Šta bi tebi točno trebalo označavati rs?
c - A character.
d, i - An integer.
h, x - A hex number (e.g. a colour).
f - A float.
s - A string.
z - An optional string.
pX - An additional delimiter where X is another character.
'' - Encloses a litteral string to locate.
u - User, takes a name, part of a name or an id and returns the id if they're connected.
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
if(sscanf(params, "u", id)) Ispravljene komande:
CMD:flipcar(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1 || PlayerInfo >= 1)
{
new id;
if(sscanf(params, "u", id)) return KORISTIMES(playerid, "/flipcar [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new Float:A, vehicleid = GetPlayerVehicleID(id);
if(!IsPlayerInAnyVehicle(id)) return GRESKAMES(playerid, "Igrac nije u vozilo");
GetVehicleZAngle(vehicleid, A);
SetVehicleZAngle(vehicleid, A);
INFOMES(playerid, "{FF8C00}[FLIP CAR] | {FFFFFF}Flipovali ste auto igracu.");
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu.");
return 1;
}CMD:afv(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1)
{
new id;
if(sscanf(params, "u", id)) return KORISTIMES(playerid, "/afv [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new string;
RepairVehicle(GetPlayerVehicleID(id));
SetVehicleHealth(GetPlayerVehicleID(id), 999.0);
INFOMES(playerid, "Go popravivte voziloto.");
format(string, sizeof(string), "{FF8C00} | {FFFFFF} %s[%d] je popravio vozilo igracu %s[%d]", GetName(playerid), playerid, GetName(id), id);
ABroadCast(COLOR_WHITE, string, 1);
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu");
return 1;
}
Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
28
Postovi:
9
Teme:
Pridružio se:Feb. 2022
13. Sep. 2023.
Paul Castellano wrote on September 13, 2023, 8:19 pm:
if(sscanf(params, "rs", id))
Šta bi tebi točno trebalo označavati rs?
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
Ispravljene komande:
Šta bi tebi točno trebalo označavati rs?
c - A character.
d, i - An integer.
h, x - A hex number (e.g. a colour).
f - A float.
s - A string.
z - An optional string.
pX - An additional delimiter where X is another character.
'' - Encloses a litteral string to locate.
u - User, takes a name, part of a name or an id and returns the id if they're connected.
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
if(sscanf(params, "u", id)) Ispravljene komande:
CMD:flipcar(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1 || PlayerInfo >= 1)
{
new id;
if(sscanf(params, "u", id)) return KORISTIMES(playerid, "/flipcar [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new Float:A, vehicleid = GetPlayerVehicleID(id);
if(!IsPlayerInAnyVehicle(id)) return GRESKAMES(playerid, "Igrac nije u vozilo");
GetVehicleZAngle(vehicleid, A);
SetVehicleZAngle(vehicleid, A);
INFOMES(playerid, "{FF8C00}[FLIP CAR] | {FFFFFF}Flipovali ste auto igracu.");
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu.");
return 1;
}CMD:afv(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1)
{
new id;
if(sscanf(params, "u", id)) return KORISTIMES(playerid, "/afv [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new string;
RepairVehicle(GetPlayerVehicleID(id));
SetVehicleHealth(GetPlayerVehicleID(id), 999.0);
INFOMES(playerid, "Go popravivte voziloto.");
format(string, sizeof(string), "{FF8C00} | {FFFFFF} %s[%d] je popravio vozilo igracu %s[%d]", GetName(playerid), playerid, GetName(id), id);
ABroadCast(COLOR_WHITE, string, 1);
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu");
return 1;
}
Hvala, probacu sad sa "u" i javim
Wheel Man
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosNovi Član
90 / 100 XP
Početnik(0)
28
Postovi:
9
Teme:
Pridružio se:Feb. 2022
14. Sep. 2023.
Paul Castellano wrote on September 13, 2023, 8:19 pm:
if(sscanf(params, "rs", id))
Šta bi tebi točno trebalo označavati rs?
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
Ispravljene komande:
Šta bi tebi točno trebalo označavati rs?
c - A character.
d, i - An integer.
h, x - A hex number (e.g. a colour).
f - A float.
s - A string.
z - An optional string.
pX - An additional delimiter where X is another character.
'' - Encloses a litteral string to locate.
u - User, takes a name, part of a name or an id and returns the id if they're connected.
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
if(sscanf(params, "u", id)) Ispravljene komande:
CMD:flipcar(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1 || PlayerInfo >= 1)
{
new id;
if(sscanf(params, "u", id)) return KORISTIMES(playerid, "/flipcar [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new Float:A, vehicleid = GetPlayerVehicleID(id);
if(!IsPlayerInAnyVehicle(id)) return GRESKAMES(playerid, "Igrac nije u vozilo");
GetVehicleZAngle(vehicleid, A);
SetVehicleZAngle(vehicleid, A);
INFOMES(playerid, "{FF8C00}[FLIP CAR] | {FFFFFF}Flipovali ste auto igracu.");
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu.");
return 1;
}CMD:afv(playerid, params[])
{
if(gPlayerLogged == 0) return GRESKAMES(playerid, "Ni ste logovani.");
if(PlayerInfo >= 1)
{
new id;
if(sscanf(params, "u", id)) return KORISTIMES(playerid, "/afv [ID/Ime na Igraca]");
if(!IsPlayerConnected(id)) return GRESKAMES(playerid, "Igrac nije online.");
new string;
RepairVehicle(GetPlayerVehicleID(id));
SetVehicleHealth(GetPlayerVehicleID(id), 999.0);
INFOMES(playerid, "Go popravivte voziloto.");
format(string, sizeof(string), "{FF8C00} | {FFFFFF} %s[%d] je popravio vozilo igracu %s[%d]", GetName(playerid), playerid, GetName(id), id);
ABroadCast(COLOR_WHITE, string, 1);
}
else GRESKAMES(playerid, "Ne mozete koristiti tu komandu");
return 1;
}
Reseno, hvala 🙂
Godfather
Balkan SA:MP
SA-MP Doprinos
Balkan SA:MP
SA-MP DoprinosAktivan Član
9 / 250 XP
Početnik(1)
2,044
Postovi:
55
Teme:
Pridružio se:Sep. 2013
14. Sep. 2023.
Paul Castellano wrote on September 13, 2023, 8:19 pm:
U ovom slučaju tebi treba ID/Ime igrača za što koristimo 'u' odnosno:
"u" se koristi za igrace i botove
"r" se koristi iskljucivo za igrace
"q" se koristi iskljucivo za botove
Ipak, ukoliko ne koristis NPCove nemas potrebe da koristis "r".
Morate biti prijavljeni da biste odgovorili na ovu temu.
Prijava