CMD:roadblock(playerid,params[])
{
if(gTeam[playerid] == POLICE ||gTeam[playerid] == FIREMEN)
{
new number;
if(sscanf(params,"d",number))
{
SendClientMessage(playerid,COLOR_BLUE,"USAGE: /roadblock <1/2/3/4/5/6/7>");
SendClientMessage(playerid,COLOR_BLUE,"| 1: Small Roadblock");
SendClientMessage(playerid,COLOR_BLUE,"| 2: Medium Roadblock");
SendClientMessage(playerid,COLOR_BLUE,"| 3: Big Roadblock");
SendClientMessage(playerid,COLOR_BLUE,"| 4: Traffic cone");
SendClientMessage(playerid,COLOR_BLUE,"| 5: Detour sign");
SendClientMessage(playerid,COLOR_BLUE,"| 6: Will be sign");
SendClientMessage(playerid,COLOR_BLUE,"| 7: Line closed sign");
SendClientMessage(playerid,COLOR_WHITE,"----------------------");
SendClientMessage(playerid,COLOR_BLUE,"/deleteall");
return 1;
}
switch(number)
{
case 1:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block = CreateObject(1459, X, Y, A,0,0,0.0);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
return 1;
}
case 2:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block2 = CreateObject(978, X, Y, A,0,0,0.0);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
return 1;
}
case 3:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block3 = CreateObject(981, X, Y, A,0,0,0.0);
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
return 1;
}
case 4:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block4 = CreateObject(1238, X, Y, A, 0.0, 0.0,0.0);
GameTextForPlayer(playerid,"~w~Cone ~b~Placed!",3000,1);
return 1;
}
case 5:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block5 = CreateObject(1425, X, Y, A, 0.0, 0.0,0.0,0.0);
GameTextForPlayer(playerid,"~w~Sign ~b~Placed!",3000,1);
return 1;
}
case 6:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block6 = CreateObject(3265, X, Y, A, 0.0, 0.0,0.0);
GameTextForPlayer(playerid,"~w~Sign ~b~Placed!",3000,1);
return 1;
}
case 7:
{
new Float:X, Float:Y, Float:Z, Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
block7 = CreateObject(3091, X, Y, A, 0.0, 0.0,0.0);
GameTextForPlayer(playerid,"~w~Sign ~b~Placed!",3000,1);
return 1;
}
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You are not a cop or a firemen so you can't use this cmd !");
}
return 1;
}
CMD:deleteall(playerid,params[])
{
DestroyObject(block);
DestroyObject(block2);
DestroyObject(block3);
DestroyObject(block4);
DestroyObject(block5);
DestroyObject(block6);
DestroyObject(block7);
return 1;
}
Why do you have playerid in your CreateObject statements?
Ow, and the Angle (A) should be Z rotation (last param) . Now you're rotating the object over the x-asis, which will mess up. |
Use sscanf to get the params in one command. You can get it and there is also a tutorial HERE.
|
You might wanna check this.
|
Try making a command and post what you come up with and we can help.
|
Dude ?! This is a CMD !!! And i have a own server, so i know how to make a cmd >_<
|