03.10.2014, 07:58
So baiscly i based the cmd on dynamic object edit but it doesent work ;/
This is how the car creation cmd looks like
This is how object editing looks like:
Errors what i get.
PHP Code:
CMD:editveh(playerid, params[])
{
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]");
5457 if(!VehInfo[idx][vModel]) return SendClientMessage(playerid, COLOR_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(playerid, VehInfo[idx][veh]);
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 Code:
CMD:createveh(playerid, params[])
{
new string[128], object;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pMapper] < 3) 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", object)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /createveh [modelid]");
for(new idx=1; idx<MAX_vvveh; idx++)
{
if(!vvvehInfo[idx][vvvModel])
{
GetPlayerPos(playerid, vvvehInfo[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(string, sizeof(string), "MapperWarn: %s has spawned dynamic vehicle %d. (Model: %d)", RPN(playerid), idx, object);
SendClientMessage(playerid, COLOR_WHITE, "You may save a new position with /saveveh");
SendMapperMessage(COLOR_GREEN, 1, string);
idx = MAX_vvveh;
}
}
return 1;
}
PHP Code:
CMD:editobj(playerid, params[])
{
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]: /editobj [objectid]");
if(!ObjInfo[idx][oModel]) return SendClientMessage(playerid, COLOR_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(playerid, ObjInfo[idx][obj]);
format(string, sizeof(string), " You are now editing object ID %d's position.", idx);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "MapperWarn: %s is editting object ID %d's position.)", RPN(playerid), idx);
SendMapperMessage(COLOR_GREEN, 1, string);
return 1;
}
PHP Code:
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : error 017: undefined symbol "VehInfo"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : warning 215: expression has no effect
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : error 001: expected token: ";", but found "]"
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : error 029: invalid expression, assumed zero
E:\Linux no SUNC\gamemodes\HTLS-RP.pwn(5457) : fatal error 107: too many error messages on one line