Spongibubu Posted April 28, 2018 Report Share Posted April 28, 2018 Salutare! Intâmpin o problema la comanda /v. Când scriu /v îmi spune SERVER: Unknown command. Ce aș putea face? Aveți aici codul: CMD:v(playerid, params[]) { ShowPlayerVehicle(playerid); return 1; } stock ShowPlayerVehicle(playerid) { new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024]; if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own any vehicles."); format(szTitle, sizeof(szTitle), "Vehicles (%d/4)", GetVehicles(playerid)); for(new i = 0; i < 5; i++) { if(PlayerInfo[playerid][pCarKey][i] != 0) { new car = PlayerInfo[playerid][pCarKey][i]; if(IsVehicleOccupied(CarInfo[car][cSpawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else if(CarInfo[car][cSpawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else format(vstatus, sizeof(vstatus), "{FF0000}(Despawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); format(szDialog, sizeof(szDialog), "%s\n", vstatus); strcat(szDialog2, szDialog); } ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit"); } return 1; } O zi frumoasă vă doresc! Quote Link to comment Share on other sites More sharing options...
0 PawnFox Posted April 29, 2018 Report Share Posted April 29, 2018 Asigura-te ca la OnPlayerCommand text ai return 0; Quote 94.23.120.101:7778 Link to comment Share on other sites More sharing options...
0 Spongibubu Posted April 29, 2018 Author Report Share Posted April 29, 2018 Folosesc iZCMD si nu am in gm OnPlayerCommandText Quote Link to comment Share on other sites More sharing options...
0 Mister Posted April 29, 2018 Report Share Posted April 29, 2018 Baga crashdetect porneste serveru scrie comanda sa iti dea iar acea eroare si arata noul server log, problema asta o face doar contului tau sa la toata lumea? E posibil ca variabila playerului din baza de date "Carkey1" 2 sau 3 sau cat ai, acel id sa nu fie in tabelul "vehicles" Quote __ ____ __ / |/ (_)____/ /____ _____ / /|_/ / / ___/ __/ _ \/ ___/ / / / / (__ ) /_/ __/ / /_/ /_/_/____/\__/\___/_/ SERVICII SCRIPTING DE CALITATE Pagina Scripting pawn Link to comment Share on other sites More sharing options...
0 PrtSc Posted April 29, 2018 Report Share Posted April 29, 2018 Incearca cu alt cont. Poate ai mai multe masini decat limita. Quote Link to comment Share on other sites More sharing options...
0 RGEO. Posted April 29, 2018 Report Share Posted April 29, 2018 Acum 45 minute, Korrea a spus: Incearca cu alt cont. Poate ai mai multe masini decat limita. Sau are mai multe sloturi decat limita/nu are nici-un slot. Quote Link to comment Share on other sites More sharing options...
0 Spongibubu Posted April 29, 2018 Author Report Share Posted April 29, 2018 (edited) [debug] Run time error 4: "Array index out of bounds" [debug] Attempted to read/write array element at index 2 in array of size 2 [debug] AMX backtrace: [debug] #0 00061304 in public OnLogin (0) from gm.amx [debug] Run time error 4: "Array index out of bounds" [debug] Attempted to read/write array element at negative index -400 [debug] AMX backtrace: [debug] #0 00069ecc in ?? (0) from gm.amx [debug] #1 0004c524 in public cmd_v (0, 18849172) from gm.amx [debug] #2 native CallLocalFunction () from samp-server.exe [debug] #3 00000564 in public OnPlayerCommandText (0, 18849160) from gm.amx Am vazut ce spune si e ciudat, deoarece ar trebui sa mearga. Voi schimba pCarKey[4] cu pCarKey1 etc. Edited April 29, 2018 by Spongibubu Quote Link to comment Share on other sites More sharing options...
0 Spongibubu Posted April 30, 2018 Author Report Share Posted April 30, 2018 (edited) Va rog putin ajutor. Edited April 30, 2018 by Spongibubu Quote Link to comment Share on other sites More sharing options...
0 valivaly96 Posted April 30, 2018 Report Share Posted April 30, 2018 La 28.04.2018 la 16:02, Spongibubu a spus: Salutare! Intâmpin o problema la comanda /v. Când scriu /v îmi spune SERVER: Unknown command. Ce aș putea face? Aveți aici codul: CMD:v(playerid, params[]) { ShowPlayerVehicle(playerid); return 1; } stock ShowPlayerVehicle(playerid) { new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024]; if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own any vehicles."); format(szTitle, sizeof(szTitle), "Vehicles (%d/4)", GetVehicles(playerid)); for(new i = 0; i < 5; i++) { if(PlayerInfo[playerid][pCarKey][i] != 0) { new car = PlayerInfo[playerid][pCarKey][i]; if(IsVehicleOccupied(CarInfo[car][cSpawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else if(CarInfo[car][cSpawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else format(vstatus, sizeof(vstatus), "{FF0000}(Despawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); format(szDialog, sizeof(szDialog), "%s\n", vstatus); strcat(szDialog2, szDialog); } ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit"); } return 1; } O zi frumoasă vă doresc! Inlocuieste if(PlayerInfo[playerid][pCarKey][i] != 0) cu if(PlayerInfo[playerid][pCarKey][i] >0) sau if(PlayerInfo[playerid][pCarKey][i] != -1) Quote Link to comment Share on other sites More sharing options...
0 Spongibubu Posted April 30, 2018 Author Report Share Posted April 30, 2018 1 hour ago, valivaly96 said: Inlocuieste if(PlayerInfo[playerid][pCarKey][i] != 0) cu if(PlayerInfo[playerid][pCarKey][i] >0) sau if(PlayerInfo[playerid][pCarKey][i] != -1) Tot nu merge. Quote Link to comment Share on other sites More sharing options...
0 valivaly96 Posted April 30, 2018 Report Share Posted April 30, 2018 Acum 4 ore, Spongibubu a spus: Tot nu merge. CMD:v(playerid, params[]) { ShowPlayerVehicle(playerid); return 1; } stock ShowPlayerVehicle(playerid) { new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024]; if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own any vehicles."); format(szTitle, sizeof(szTitle), "Vehicles (%d/4)", GetVehicles(playerid)); for(new i = 0; i < 5; i++) { if(PlayerInfo[playerid][pCarKey][i] > 0) { new car = PlayerInfo[playerid][pCarKey][i]; if(IsVehicleOccupied(CarInfo[car][cSpawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else if(CarInfo[car][cSpawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else format(vstatus, sizeof(vstatus), "{FF0000}(Despawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); format(szDialog, sizeof(szDialog), "%s\n", vstatus); strcat(szDialog2, szDialog); } ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit"); } return 1; } Daca nu merge ce erori ai in consola cu codul modificat? Quote Link to comment Share on other sites More sharing options...
0 Spongibubu Posted May 1, 2018 Author Report Share Posted May 1, 2018 17 hours ago, valivaly96 said: CMD:v(playerid, params[]) { ShowPlayerVehicle(playerid); return 1; } stock ShowPlayerVehicle(playerid) { new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024]; if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_GREY, "You don't own any vehicles."); format(szTitle, sizeof(szTitle), "Vehicles (%d/4)", GetVehicles(playerid)); for(new i = 0; i < 5; i++) { if(PlayerInfo[playerid][pCarKey][i] > 0) { new car = PlayerInfo[playerid][pCarKey][i]; if(IsVehicleOccupied(CarInfo[car][cSpawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else if(CarInfo[car][cSpawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); else format(vstatus, sizeof(vstatus), "{FF0000}(Despawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]); format(szDialog, sizeof(szDialog), "%s\n", vstatus); strcat(szDialog2, szDialog); } ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit"); } return 1; } Daca nu merge ce erori ai in consola cu codul modificat? [debug] Run time error 4: "Array index out of bounds" [debug] Attempted to read/write array element at index 2 in array of size 2 [debug] AMX backtrace: [debug] #0 00062188 in public OnLogin (0) from gm.amx [debug] Run time error 4: "Array index out of bounds" [debug] Attempted to read/write array element at negative index -400 [debug] AMX backtrace: [debug] #0 0006ab60 in ?? (0) from gm.amx [debug] #1 0004d5e8 in public cmd_v (0, 18800116) from gm.amx [debug] #2 native CallLocalFunction () from samp-server.exe [debug] #3 00000564 in public OnPlayerCommandText (0, 18800104) from gm.amx Quote Link to comment Share on other sites More sharing options...
Question
Spongibubu
Salutare! Intâmpin o problema la comanda /v. Când scriu /v îmi spune SERVER: Unknown command.
Ce aș putea face?
Aveți aici codul:
O zi frumoasă vă doresc!
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.