06.06.2016, 11:25
title.
so when i use /bdeploy 1 test
it shows BARRIER 1 TEST
and when i do /bdeploy 2 banana
it shows:
BARRIER 1 Tbanana
BARRIER 2 banana
this is my code
so when i use /bdeploy 1 test
it shows BARRIER 1 TEST
and when i do /bdeploy 2 banana
it shows:
BARRIER 1 Tbanana
BARRIER 2 banana
this is my code
PHP код:
COMMAND:bdeploy(playerid, params[])
{
if(!IsPlayerFED(playerid)) return SendClientError(playerid, CANT_USE_CMD);
if(PlayerInfo[playerid][ranklvl] == 2 && PlayerInfo[playerid][authority_bdeploy] != 1) return SendClientError(playerid, CANT_USE_CMD);
if(PlayerInfo[playerid][ranklvl] > 2) return SendClientError(playerid, CANT_USE_CMD);
new bid,roadNote1337[420],kankerzooi[420];
if( sscanf ( params, "ds", bid,roadNote1337)) return SCP(playerid, "[barrierID] [NOTE]");
if(bid < 1 || bid > MAX_BARRIERS) return SCP(playerid, "ID not found.");
if(roadBlock[ bid ] == 1) return SendClientError(playerid, "That roadblock already exists.");
roadBlock[ bid ] = 1;
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, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
SetPlayerPos(playerid, X-1, Y, Z+2);
format(kankerzooi,sizeof(kankerzooi),"Barrier %d",bid);
roadLabel[bid] = Create3DTextLabel(kankerzooi, COLOR_LIGHTGREY, X,Y,Z,10,0,0);
Action(playerid, "is deploying a road block.");
format(roadNote[bid], 420, "%s", roadNote1337);
return 1;
}