SA-MP Forums Archive
Editveh for car positioning help needed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Editveh for car positioning help needed (/showthread.php?tid=540193)



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 017undefined 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 219local variable "vehicleid" shadows a variable at a preceding level
E
:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27134) : error 017undefined symbol "idx"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27134) : warning 215expression has no effect
E
:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : error 001expected token","but found "["
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : error 029invalid expressionassumed zero
E
:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : warning 215expression has no effect
E
:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : error 001expected token";"but found "]"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(27142) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB 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:oldvdXFloat:oldvdYFloat:oldvdZFloat:oldvdRXFloat:oldvdRYFloat:oldvdRZ
PHP код:
vEdit[playerid] = 0vEditID[playerid] = 0
PHP код:
CMD:editveh(playeridparams[])
{
    new 
vehicleid GetPlayerVehicleID(playerid);
    new 
string[128], idx;
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
PlayerInfo[playerid][pMapper] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    if(!
mDuty[playerid]) return SendClientMessage(playeridCOLOR_GREY"You are not on Mapper Duty.");
    if(
sscanf(params"i"idx)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /editveh [vehicleid]");
    if(!
vvvehInfo[idx][vvvModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid vehicle id.");
    
vEdit[playerid] = 1;
    
vEditID[playerid] = idx;
    
SetVehiclePos(vehicleidvPos[0], vPos[1], vPos[2]);
    
SetVehicleZAngle(vehicleidvRot[2]);
5471    EditVehiclePos(playeridvvvehInfo[idx][vvveh]);
    
format(stringsizeof(string), " You are now editing vehicle ID %d's position."idx);
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(stringsizeof(string), "MapperWarn: %s is editting vehicle ID %d's position.)"RPN(playerid), idx);
    
SendMapperMessage(COLOR_GREEN1string);
    return 
1;

PHP код:
27131 public OnPlayerEditVehicle(playeridvehicleidresponseFloat:xFloat:yFloat:zFloat:rxFloat:ryFloat:rz)
{
27134   new vehicleid GetPlayerVehicleID(playerid);
27135  idx vEditID[playerid];
    if(
response == EDIT_RESPONSE_UPDATE)
    {
        
SetVehiclePos(vehicleidxyz);
        
SetVehicleZAngle(vehicleidrz);
    }
    else if(
response == EDIT_RESPONSE_CANCEL)
    {
27143        SetVehiclePos(vehicleidvPos[playerid][0], vPos[playerid][1], vPos[playerid][2]);
        
SetVehicleZAngle(vehicleidvRot[playerid][2]);
        
vPos[playerid][0] = 0vPos[playerid][1] = 0vPos[playerid][2] = 0;
        
vRot[playerid][2] = 0;
        
format(stringsizeof(string), " You have canceled editing vehicle ID %d."idx);
        
SendClientMessage(playeridCOLOR_WHITEstring);
    }
    else if(
response == EDIT_RESPONSE_FINAL)
    {
        
SetVehiclePos(vehicleidxyz);
        
SetVehicleZAngle(vehicleidrz);
        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(stringsizeof(string), " You have finished editing vehicle ID %d's position."idx);
            
SendClientMessage(playeridCOLOR_WHITEstring);
        }
    }
    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.