/roadblock
#1

Anyone can fix that something wrong for it

pawn Код:
format(string, sizeof(string), "HQ: A roadblock has been deployed by %s, it has been marked on the map by a checkpoint.", ;
        for(new 1 = 0; i++ < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pMember] == 1 || PlayerInfo[i][pLeader] == 1)
                {
                    SetPlayerCheckpoint(playerid, X, Y, Z-10, 1.0);
                    SendClientMessage(i, TEAM_BLUE_COLOR, string);
                    if (PlayerInfo[i][pRank] >= 5 && PlayerInfo[i][pMember] || PlayerInfo[i][pLeader] == 1)
                    {
                        SendClientMessage(i, COLOR_YELLOW, "You can remove all roadblocks by typing /rrball");
                   {
                }
            }
        }
        SetTimer("ResetRoadblockTimer", 60000, false);
        return 1;
    }

    if(strcmp(cmdtext, "/roadunblock", true)==1 || strcmp(cmdtext, "/rrb", true)==1)
    {
        if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1 && PlayerInfo[playerid][pMember] != 2 && PlayerInfo[playerid][pLeader] == 1)
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not a cop!");
            return 1;
        }
        if (PlayerInfo[playerid][pMember] == 3 && PlayerInfo[playerid][pRank] < 3)
        {
            SendClientMessage(playerid, COLOR_GREY, "You have to be rank 3 to use this command!");
            return 1;
        }
        if (PlayerInfo[playerid][pRoadblock] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY, "You haven't deployed a roadblock!");
            return 1;
        }
        RemoveRoadblock(playerid);
        SendClientMessage(playerid, COLOR_GREEN, "Roadblock removed successfully.");
        return 1;
    }

    if(strcmp(cmdtext, "/roadunblockall", true)==0 || strcmp(cmdtext, "/rrball", true)==0)
    {
        if ((PlayerInfo[playerid][pRank] >= 3 && PlayerInfo[playerid][pMember] == 1) || PlayerInfo[playerid][pLeader] == 1)
        {
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(PlayerInfo[i][pRoadblock] != 0)
                {
                    RemoveRoadblock(i);
                }
            }
            GetPlayerName(playerid, sendername, sizeof sendername);
            format(string, sizeof(string), "HQ: All roadblocks in the area are to be disbanded immediately by order of %s.", sendername);
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pMember] == 3 || PlayerInfo[i][pLeader] == 1)
                    {
                        SendClientMessage(i, TEAM_BLUE_COLOR, string);
                    }
                }
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You have to be rank 3+ or a police leader to remove all roadblocks!");
        }
        return 1;
    }
Link: http://pawn.pastebin.com/88PejaVc

Errors:
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16555) : error 029: invalid expression, assumed zero
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16555 -- 16556) : error 001: expected token: ",", but found "for"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16556) : warning 217: loose indentation
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16556) : error 001: expected token: "-identifier-", but found "-integer value-"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16556) : fatal error 107: too many error messages on one line
Reply
#2

That's really messy, put it into [pawn] tags next time.

You need to add the name identifier so it will say what it needs to. Also, remember to close all (). That is causeing the string error.

Fix:
pawn Код:
format(string, sizeof(string), "HQ: A roadblock has been deployed by %s, it has been marked on the map by a checkpoint.", pname);
Reply
#3

Now i have that errors:

D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16555) : error 017: undefined symbol "pname"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16556) : warning 217: loose indentation
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16556) : error 001: expected token: "-identifier-", but found "-integer value-"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16558 ) : error 029: invalid expression, assumed zero
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16560) : error 017: undefined symbol "i"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16562) : error 017: undefined symbol "X"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16563) : error 017: undefined symbol "i"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16564) : error 017: undefined symbol "i"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16566) : error 017: undefined symbol "i"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16567) : warning 217: loose indentation
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16571) : warning 217: loose indentation
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16575) : warning 217: loose indentation
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16587) : error 017: undefined symbol "pRoadblock"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16592) : error 017: undefined symbol "RemoveRoadblock"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16603) : error 017: undefined symbol "pRoadblock"
D:\Lataukset\Server\Server\Script\gamemodes\mrp.pw n(16605) : error 017: undefined symbol "RemoveRoadblock"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
Reply
#4

Anyone can please fix it.
Reply
#5

Dude, obvious errors. Please, just, go, to, here, at, the, wiki, https://sampwiki.blast.hk/ THEN FUCKING READ EVERY ASPECT!
Reply
#6

dude just search throughout this samp forums I guarantee that you will find million of road block commands
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)