21.03.2014, 21:33
Object ID for the barrier is: 978 (just if you wanted to know)
So, the problem is that I'm not able to run a certain command in order to place a deployment at my position. However, this works fine for adding spikes but not the barrier deploy.
Heres a code of my CMD:
Nothing is wrong in the code, no errors. The command runs fine, but when I do this in game the object won't appear. It's not there.
Any help? Maybe I should've explained a little better but if any of you need more information just tell me and I will give.
So, the problem is that I'm not able to run a certain command in order to place a deployment at my position. However, this works fine for adding spikes but not the barrier deploy.
Heres a code of my CMD:
PHP код:
COMMAND:bdeploy(playerid, params[])
{
if(!IsPlayerFED(playerid)) return SendClientError(playerid, CANT_USE_CMD);
new bid;
if( sscanf ( params, "d", bid)) return SCP(playerid, "[barrierID]");
if(bid < 1 || bid > MAX_BARRIERS) return SCP(playerid, "[barrierID]");
if(roadBlock[ bid ] == 1) return SendClientError(playerid, "That roadblock already exists. USE: /bremove");
roadBlock[ bid ] = 1;
format(roadBlockPlayer[ bid ], 32, "%s", PlayerName(playerid));
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
// CreateDynamicObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, playerid = -1, Float:distance = 200.0);
roadBlockObj[ bid ] = CreateDynamicObject(978, X, Y, Z, 0.0, 0.0, A,0,0,-1,250);
SetPlayerPos(playerid, X-1, Y, Z+2);
Action(playerid, "is deploying a road block.");
return 1;
}
Any help? Maybe I should've explained a little better but if any of you need more information just tell me and I will give.