/createrb - CreateDynamicObject low in ground - 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: /createrb - CreateDynamicObject low in ground (
/showthread.php?tid=379547)
/createrb - CreateDynamicObject low in ground -
MrSnapp - 22.09.2012
I made my command (listed below with stock) but when its created it's halfway in the ground how do I fix this? Thanks
Command:
pawn Код:
CMD:createrb(playerid, params[])
{
new string[128], Float:Pos[4];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an SAPD Oficer.");
if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(PlayerInfo[playerid][pFacRank] < 4) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command. (Rank 4+)");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
CreateRoadblock(Pos[0], Pos[1], Pos[2],Pos[3]);
format(string, sizeof(string), "SAPD: %s has created a road block.", RPN(playerid));
SendCopMessage(COLOR_BLUE, string);
return 1;
}
Stock:
pawn Код:
stock CreateRoadblock(Float:x,Float:y,Float:z,Float:Angle)
{
for(new i = 0; i < sizeof(RoadblockInfo); i++)
{
if(RoadblockInfo[i][sCreated] == 0)
{
RoadblockInfo[i][sCreated]=1;
RoadblockInfo[i][sX]=x;
RoadblockInfo[i][sY]=y;
RoadblockInfo[i][sZ]=z-0.7;
RoadblockInfo[i][sObject] = CreateDynamicObject(978, x, y, z-0.9, 0, 0, Angle-90);
return 1;
}
}
return 0;
}
Re: /createrb - CreateDynamicObject low in ground -
MrSnapp - 22.09.2012
Got it solved!