problem with zcmd and vehicle respawn. -
WuPoR - 05.03.2014
Hey!
I have 2 problems.
So, first problem with zcmd command. Code:
PHP код:
CMD:remontuoti(playerid)
{
if(pDT[playerid][pMasina] == -1) return SendClientMessage(playerid, RED,"* ** You didn't have a car!");
new v = pDT[playerid][pMasina],// pMasina means player Car
kaina = ShopVehicles[v][Price]/2,
s[ 128 ];
if(vDT[v][death])
{
format(s,sizeof(s),"{FFFFFF}Jūsų transporto priemonės taisymas kainuos{FF0000}%i{FFFFFF}LT\nAr tikrai norite susiremontuoti transportą?",kaina);
ShowPlayerDialog(playerid, 40, DIALOG_STYLE_MSGBOX,"Transporto remontas",s,"Remontuoti","Atљaukti");
}
else SendClientMessage(playerid, RED,"* ** Car isn't death!");
return 1;
}
When i use this command in game, command didn't work.. Just "Unknown command"...
Second problem with vehicle's respawn.
I use this code in timer
PHP код:
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!IsAnyPlayerInVehicle(v))
{
if(vDT[v][nuoma] || vDT[v][VMv] || vDT[v][VMvm] || vDT[v][parduodama]) SetVehicleToRespawn(v);
}
}
And when timer works, the server freezes, and about 15 seconds later unfreezes.. Anybody know where is the problem ?
p.s sorry for my bad english
Re: problem with zcmd and vehicle respawn. -
Konstantinos - 05.03.2014
About the unknown command:
- load crashdetect plugin:
https://github.com/Zeex/samp-plugin-...ases/tag/v4.13
- use debug info:
https://github.com/Zeex/samp-plugin-...ith-debug-info
Re-compile your scripts, start the server and execute /remontuoti. If it displays the unknown command, then post the server log.
About the timer: looping 2000 (vehicles) times + N (players) everytime would cause some lag.
Re: problem with zcmd and vehicle respawn. -
WuPoR - 05.03.2014
[21:41:50] [debug] Run time error 4: "Array index out of bounds"
[21:41:50] [debug] Accessing element at index 65535 past array upper bound 2
[21:41:50] [debug] AMX backtrace:
[21:41:50] [debug] #0 0002586c in public cmd_remontuoti (0x00000000, 0x00093c74) from xSF.amx
[21:41:50] [debug] #1 native CallLocalFunction () [00472ad0] from samp-server.exe
[21:41:50] [debug] #2 000003f8 in public OnPlayerCommandText (0x00000000, 0x00093c44) from xSF.amx
Re: problem with zcmd and vehicle respawn. -
Konstantinos - 05.03.2014
Did you use debug info? It doesn't say why it crashed, it says only the public function:
pawn Код:
CMD:remontuoti(playerid)
{
if(pDT[playerid][pMasina] == -1) return SendClientMessage(playerid, RED,"* ** You didn't have a car!");
new v = pDT[playerid][pMasina],// pMasina means player Car
kaina = ShopVehicles[v][Price]/2,
s[ 128 ];
if(vDT[v][death])
{
format(s,sizeof(s),"{FFFFFF}Jūsų transporto priemonės taisymas kainuos{FF0000}%i{FFFFFF}LT\nAr tikrai norite susiremontuoti transportą?",kaina);
ShowPlayerDialog(playerid, 40, DIALOG_STYLE_MSGBOX,"Transporto remontas",s,"Remontuoti","Atšaukti");
}
else SendClientMessage(playerid, RED,"* ** Car isn't death!");
return 1;
}
By the way, use:
pawn Код:
CMD:remontuoti(playerid, params[])
because maybe if you use parameters (an example: "/remontuoti blabla") it can cause it (not sure).
Re: problem with zcmd and vehicle respawn. -
XK - 05.03.2014
Yea konstantinos,i think he should do it:
pawn Код:
CMD:remontuoti(playerid, params[])
Re: problem with zcmd and vehicle respawn. -
WuPoR - 06.03.2014
same shit