Help me out alittle here guys.
#1

Ok so I made this roadblock script:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/addroadblock", true)) {
    SendClientMessage(playerid, WHITE, "You are placing a roadblock now.");
    GetPlayerPos(playerid, Float:x, Float:y, Float:z);
    recentroadblock1 = CreateObject(1459, x, y+2, z-0.5, 0, 0, 0);
    recentroadblock2 = CreateObject(1459, x, y+4, z-0.5, 0, 0, 0);
    recentroadblock3 = CreateObject(1459, x, y+6, z-0.5, 0, 0, 0);
    recentroadblock4 = CreateObject(1459, x, y+8, z-0.5, 0, 0, 0);
  }
  if(!strcmp(cmdtext, "/roadblockbegone", true)) {
   DestroyObject(recentroadblock1);
   DestroyObject(recentroadblock2);
   DestroyObject(recentroadblock3);
   DestroyObject(recentroadblock4);
   SendClientMessage(playerid, WHITE, "You have destroyed your recently made road block.");
   }
  return 1;
}
Can any one help me to turn it so It makes the road block the angle they are facing?
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/addroadblock", true))
    {
        new angle;
        GetPlayerFacingAngle(playerid, angle);
        SendClientMessage(playerid, WHITE, "You are placing a roadblock now.");
        GetPlayerPos(playerid, Float:x, Float:y, Float:z);
        recentroadblock1 = CreateObject(1459, x, y+2, z-0.5, angle, 0, 0);
        recentroadblock2 = CreateObject(1459, x, y+4, z-0.5, angle, 0, 0);
        recentroadblock3 = CreateObject(1459, x, y+6, z-0.5, angle, 0, 0);
        recentroadblock4 = CreateObject(1459, x, y+8, z-0.5, angle, 0, 0);
       
    }
    if(!strcmp(cmdtext, "/roadblockbegone", true))
    {
        DestroyObject(recentroadblock1);
        DestroyObject(recentroadblock2);
        DestroyObject(recentroadblock3);
        DestroyObject(recentroadblock4);
        SendClientMessage(playerid, WHITE, "You have destroyed your recently made road block.");
       
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)