Problema intalnita (descriere): Am incercat de pe net sa fac comanda freezecar din motive personale.Am gasit un stock cu comanda si cand sa adaug ToggleVehicleControllable(vehicleid, 1); nu merge,imi da erori. Ero(area / rile) / warning-(ul / urile):
a2viata.pwn(15921) : error 028: invalid subscript (not an array or too many subscripts): "FrozenPos"
a2viata.pwn(15921) : warning 215: expression has no effect
a2viata.pwn(15921) : error 001: expected token: ";", but found "]"
a2viata.pwn(15921) : error 029: invalid expression, assumed zero
a2viata.pwn(15921) : fatal error 107: too many error messages on one line
if(strcmp(cmd, "/blockveh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "UTILIZEAZA: /blockveh [ID vehicul]");
return 1;
}
if(IsACop(playerid))
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
ToggleVehicleControllable(playa, 0);
GameTextForPlayer(playa, "~r~Vehicul Oprit de la Telecomanda", 5000, 3);
SendClientMessage(playerid, COLOR_BLACK, "Ai apasat butonul 'Oprit' de pe telecomanda si ai oprit masina momeala.");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Nu esti autorizat pentru folosirea comenzii!");
}
}
return 1;
}
Stock-ul:
stock ToggleVehicleControllable(vehicleid, bool: status)
{
if(status == false)
{
new Float: pos[3];
GetVehiclePos(vehicleid, pos[0], pos[1], pos[2]);
FrozenPos[vehicleid][0] = pos[0], FrozenPos[vehicleid][1] = pos[1], FrozenPos[vehicleid][2] = pos[2];
FrozenTimer[vehicleid] = SetTimerEx("CheckPos", 1000, true, "d", vehicleid);
return 1;
}
else
{
KillTimer(FrozenTimer[vehicleid]);
FrozenTimer[vehicleid] = -1;
}
return true;
} Imagini / Video (optional): - Ati incercat sa rezolvati singur?: Da.Am incercat.Si mai am o problema,cred ca da freeze playerului nu masinii:| Am o banuiala dar nu stiu exact fiindca nu am testat.
Question
Bogdan's
Problema intalnita (descriere): Am incercat de pe net sa fac comanda freezecar din motive personale.Am gasit un stock cu comanda si cand sa adaug ToggleVehicleControllable(vehicleid, 1); nu merge,imi da erori.
Liniile de cod / sursa / script-ul(obligatoriu): Restul scriptului: Stock-ul:Ero(area / rile) / warning-(ul / urile):
Link to comment
Share on other sites
15 answers to this question
Recommended Posts