cmd to edit dynamic vehicle positions
#1

So baiscly i based the cmd on dynamic object edit but it doesent work ;/

PHP Code:
CMD:editveh(playeridparams[])
{
    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]");
5457    if(!VehInfo[idx][vModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid vehicle id.");
    
vEdit[playerid] = 1;
    
vEditID[playerid] = idx;
    
GetDynamicVehiclePos(VehInfo[idx][obj], vPos[playerid][0], vPos[playerid][1], vPos[playerid][2]);
    
GetDynamicVehicleRot(VehInfo[idx][obj], vRot[playerid][0], vRot[playerid][1], vRot[playerid][2]);
    
EditDynamicVehicle(playeridVehInfo[idx][veh]);
    
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;

This is how the car creation cmd looks like
PHP Code:
CMD:createveh(playeridparams[])
{
    new 
string[128], object;
       if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
PlayerInfo[playerid][pMapper] < 3) 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"object)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /createveh [modelid]");
    for(new 
idx=1idx<MAX_vvvehidx++)
    {
        if(!
vvvehInfo[idx][vvvModel])
        {
            
GetPlayerPos(playeridvvvehInfo[idx][vvvX], vvvehInfo[idx][vvvY], vvvehInfo[idx][vvvZ]);
              
vvvehInfo[idx][vvvModel] = object;
            
vvvehInfo[idx][vvvX] = vvvehInfo[idx][vvvX] + 2;
            
vvvehInfo[idx][vvvY] = vvvehInfo[idx][vvvY] + 2;
            
vvvehInfo[idx][vvvZ] = vvvehInfo[idx][vvvZ] + 2;
            
vvvehInfo[idx][vvvAn] =0;
            
vvvehInfo[idx][vvvC1] =0;
            
vvvehInfo[idx][vvvC2] =0;
            
// Creating
            
vvvehInfo[idx][vvveh] = CreateVehicle(vvvehInfo[idx][vvvModel], vvvehInfo[idx][vvvX], vvvehInfo[idx][vvvY], vvvehInfo[idx][vvvZ], vvvehInfo[idx][vvvAn], vvvehInfo[idx][vvvC1], vvvehInfo[idx][vvvC2], 1200);
            
// Text
            
format(stringsizeof(string), "MapperWarn: %s has spawned dynamic vehicle %d. (Model: %d)"RPN(playerid), idxobject);
            
SendClientMessage(playeridCOLOR_WHITE"You may save a new position with /saveveh");
            
SendMapperMessage(COLOR_GREEN1string);
            
idx MAX_vvveh;
        }
    }
    return 
1;

This is how object editing looks like:
PHP Code:
CMD:editobj(playeridparams[])
{
    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]: /editobj [objectid]");
    if(!
ObjInfo[idx][oModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid object id.");
    
oEdit[playerid] = 1;
    
oEditID[playerid] = idx;
    
GetDynamicObjectPos(ObjInfo[idx][obj], oPos[playerid][0], oPos[playerid][1], oPos[playerid][2]);
    
GetDynamicObjectRot(ObjInfo[idx][obj], oRot[playerid][0], oRot[playerid][1], oRot[playerid][2]);
    
EditDynamicObject(playeridObjInfo[idx][obj]);
    
format(stringsizeof(string), " You are now editing object ID %d's position."idx);
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(stringsizeof(string), "MapperWarn: %s is editting object ID %d's position.)"RPN(playerid), idx);
    
SendMapperMessage(COLOR_GREEN1string);
    return 
1;

Errors what i get.
PHP Code:
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : error 017undefined symbol "VehInfo"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : warning 215expression has no effect
E
:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : error 001expected token";"but found "]"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : error 029invalid expressionassumed zero
E
:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : fatal error 107too many error messages on one line 
Reply


Messages In This Thread
cmd to edit dynamic vehicle positions - by weedxd - 03.10.2014, 07:58
Respuesta: cmd to edit dynamic vehicle positions - by ghost556 - 03.10.2014, 08:01
Re: Respuesta: cmd to edit dynamic vehicle positions - by weedxd - 03.10.2014, 08:04
Respuesta: cmd to edit dynamic vehicle positions - by ghost556 - 03.10.2014, 08:19
Re: cmd to edit dynamic vehicle positions - by weedxd - 03.10.2014, 08:24

Forum Jump:


Users browsing this thread: 2 Guest(s)