SA-MP Forums Archive
/deployroadblock help please - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /deployroadblock help please (/showthread.php?tid=257903)



/deployroadblock help please - seanny - 28.05.2011

Hello My scripter made a mistake when he made the /deployroadblock
the problem is when we go IG, it does NOT show an object

Well here is the command
pawn Код:
if(strcmp(cmd, "/deployroadblock", true) == 0)
    {
        if(!IsACop(playerid) || PlayerInfo[playerid][pMember] == 5)
        {
            return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASD / PG !");
        }
        if(PlayerInfo[playerid][pRank] < 1)
        {
           return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be Placing road blocks !");
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            return SendClientMessage(playerid,COLOR_GREY,"   You cannot place a road block while inside a vehicle !");
        }
        new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
        GetPlayerPos(playerid,plocx,plocy,plocz);
        GetPlayerFacingAngle(playerid,ploca);
        new location[MAX_ZONE_NAME];
        GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
        new Float:x, Float:y, Float:z, Float:angle;
        GetPlayerFacingAngle(playerid, angle);
        GetPlayerPos(playerid, x, y, z);
        CreateRoadBlock(x, y, z, angle);
        format(string, sizeof(string), "HQ: %s %s has placed a roadblock at %s", GetPlayerRank(playerid),PlayerName(playerid), location);
        SendRadioMessage(1, TEAM_BLUE_COLOR, string);
        SendRadioMessage(2, TEAM_BLUE_COLOR, string);
        SendRadioMessage(3, TEAM_BLUE_COLOR, string);
        SendRadioMessage(5, TEAM_BLUE_COLOR, string);
        /*GetPlayerFacingAngle(playerid,ploca);
        CreateStrip(plocx,plocy,plocz,ploca);*/

        return 1;



Re: /deployroadblock help please - Vince - 28.05.2011

Post function: CreateRoadBlock(x, y, z, angle);
Sidenote: You're fetching the player's position and angle twice, for I don't know what reason.


Re: /deployroadblock help please - seanny - 28.05.2011

Can you do that in full code that I used please


Re: /deployroadblock help please - Kush - 28.05.2011

pawn Код:
if(strcmp(cmd, "/deployroadblock", true) == 0)
    {
        if(!IsACop(playerid) || PlayerInfo[playerid][pMember] == 5)
        {
            return SendClientMessage(playerid,COLOR_GREY,"   You are not a Cop / FBI / SASD / PG !");
        }
        if(PlayerInfo[playerid][pRank] < 1)
        {
           return SendClientMessage(playerid,COLOR_GREY,"   Your rank is too low to be Placing road blocks !");
        }
        if(IsPlayerInAnyVehicle(playerid))
        {
            return SendClientMessage(playerid,COLOR_GREY,"   You cannot place a road block while inside a vehicle !");
        }
        new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
        GetPlayerPos(playerid,plocx,plocy,plocz);
        GetPlayerFacingAngle(playerid,ploca);
        new location[MAX_ZONE_NAME];
        GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
        new Float:x, Float:y, Float:z, Float:angle;
        GetPlayerFacingAngle(playerid, angle);
        GetPlayerPos(playerid, x, y, z);
        CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);
        format(string, sizeof(string), "HQ: %s %s has placed a roadblock at %s", GetPlayerRank(playerid),PlayerName(playerid), location);
        SendRadioMessage(1, TEAM_BLUE_COLOR, string);
        SendRadioMessage(2, TEAM_BLUE_COLOR, string);
        SendRadioMessage(3, TEAM_BLUE_COLOR, string);
        SendRadioMessage(5, TEAM_BLUE_COLOR, string);
        /*GetPlayerFacingAngle(playerid,ploca);
        CreateStrip(plocx,plocy,plocz,ploca);*/

        return 1;
      }



Re: /deployroadblock help please - seanny - 28.05.2011

Thanks

This forum requires that you wait 120 seconds between posts. Please try again in 1 seconds. <---- FUUUUU ¬_¬