Editveh for car positioning help needed -
weedxd - 03.10.2014
This is the whole cmd but i recive these errors and i could use your help guys :/ Using a_vehicles.inc
PHP код:
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5471) : error 017: undefined symbol "EditVehiclePos"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27131) : warning 235: public function lacks forward declaration (symbol "OnPlayerEditVehicle")
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27133) : warning 219: local variable "vehicleid" shadows a variable at a preceding level
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27134) : error 017: undefined symbol "idx"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27134) : warning 215: expression has no effect
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : error 001: expected token: ",", but found "["
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : error 029: invalid expression, assumed zero
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : warning 215: expression has no effect
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : error 001: expected token: ";", but found "]"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.
PHP код:
new vEdit[MAX_PLAYERS];
new vEditID[MAX_PLAYERS];
new Float:vPos[MAX_PLAYERS];
new Float:vRot[MAX_PLAYERS];
new oldvID;
new Float:oldvdX, Float:oldvdY, Float:oldvdZ, Float:oldvdRX, Float:oldvdRY, Float:oldvdRZ;
PHP код:
vEdit[playerid] = 0; vEditID[playerid] = 0;
PHP код:
CMD:editveh(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
new string[128], idx;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pMapper] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!mDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Mapper Duty.");
if(sscanf(params, "i", idx)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /editveh [vehicleid]");
if(!vvvehInfo[idx][vvvModel]) return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle id.");
vEdit[playerid] = 1;
vEditID[playerid] = idx;
SetVehiclePos(vehicleid, vPos[0], vPos[1], vPos[2]);
SetVehicleZAngle(vehicleid, vRot[2]);
5471 EditVehiclePos(playerid, vvvehInfo[idx][vvveh]);
format(string, sizeof(string), " You are now editing vehicle ID %d's position.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "MapperWarn: %s is editting vehicle ID %d's position.)", RPN(playerid), idx);
SendMapperMessage(COLOR_GREEN, 1, string);
return 1;
}
PHP код:
27131 public OnPlayerEditVehicle(playerid, vehicleid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
27134 new vehicleid = GetPlayerVehicleID(playerid);
27135 idx = vEditID[playerid];
if(response == EDIT_RESPONSE_UPDATE)
{
SetVehiclePos(vehicleid, x, y, z);
SetVehicleZAngle(vehicleid, rz);
}
else if(response == EDIT_RESPONSE_CANCEL)
{
27143 SetVehiclePos(vehicleid, vPos[playerid][0], vPos[playerid][1], vPos[playerid][2]);
SetVehicleZAngle(vehicleid, vRot[playerid][2]);
vPos[playerid][0] = 0; vPos[playerid][1] = 0; vPos[playerid][2] = 0;
vRot[playerid][2] = 0;
format(string, sizeof(string), " You have canceled editing vehicle ID %d.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(response == EDIT_RESPONSE_FINAL)
{
SetVehiclePos(vehicleid, x, y, z);
SetVehicleZAngle(vehicleid, rz);
if(vEdit[playerid] == 1)
{
oldvID = vvvehInfo[idx][vvvModel];
vvvehInfo[idx][vX] = x;
vvvehInfo[idx][vY] = y;
vvvehInfo[idx][vZ] = z;
vvvehInfo[idx][vRX] = rx;
vvvehInfo[idx][vRY] = ry;
vvvehInfo[idx][vRZ] = rz;
oldvdX = vvvehInfo[idx][vX];
oldvdY = vvvehInfo[idx][vY];
oldvdZ = vvvehInfo[idx][vZ];
oldvdRX = vvvehInfo[idx][vRX];
oldvdRY = vvvehInfo[idx][vRY];
oldvdRZ = vvvehInfo[idx][vRZ];
vEdit[playerid] = 0;
vEditID[playerid] = 0;
format(string, sizeof(string), " You have finished editing vehicle ID %d's position.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1
}
Re: Editveh for car positioning help needed -
Ox1gEN - 03.10.2014
Errors are self explanatory.
Like, read them for a second, let me go through them with you.
Error 1:
"error 017: undefined symbol "EditVehiclePos" "
What does it mean? It means you are using a function, symbol (something bassicly) that isn't defined, bassicly the script doesn't know it.
I assume EditVehiclePos is a stock, so create a stock for it.
Error 2:
"warning 235: public function lacks forward declaration (symbol "OnPlayerEditVehicle") "
There is no public functions called OnPlayerEditVehicle, therefore you need to forward it.
{ forward(OnPlayerEditVehicle); }
Error 3:
"warning 219: local variable "vehicleid" shadows a variable at a preceding level "
A local variable named vehicleid is already created somewhere in the script and you are attempting to create another one, bassicly either you have that variable several times in one place or you have a global variable which is called vehicleid and a variable called vehicleid inside a specifiec code.
Error 4:
"error 017: undefined symbol "idx" "
Going back to error 1, I assume this is a variable so just do, new idx;
Error 5:
"warning 215: expression has no effect "
The code you have inserted doesn't do shit bassicly.
Error 6:
"error 001: expected token: ",", but found "[" "
Bassicly, it expects a comma (,) but it has found [, so add a comma beforehand.
Error 7:
"error 029: invalid expression, assumed zero "
The code you have entered is invalid, try to use a working one, a valid one bassicly.
Error 8:
"warning 215: expression has no effect "
Going back to error 5
Error 9:
"error 001: expected token: ";", but found "]" "
Going back to error 6, same principle.
Error 10:
"fatal error 107: too many error messages on one line "
Bassicly, the code you have in that line has too many errors.
Now, if you understood these fixed you should know how to fix your code.