Jump to content

Question

Posted

warning 201: redefinition of constant/macro (symbol "foreach(%1,%2)")

Aveti vre-o rezolvare?

Si inca ceva cand dau /rb la PD sa pun roadblockurile nu mi se vad nustiu ce sa intamplat am modificat acolo comanda /rb si tot nu merge. Aveti si pentru asta o rezolvare?

COMANDA:

[pawn] if(strcmp(cmdtext, "/roadblock", true)==0 || strcmp(cmdtext, "/rb", true)==0)

{

if (PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pLeader] != 1) return SendClientMessage(playerid, COLOR_GREY, "You are not a Cop!");

if (PlayerInfo[playerid][pRoadblock] != 0) return SendClientMessage(playerid, COLOR_GREY, "You can only deploy 1 roadblock at a time, type /rrb to remove your existing one.");

if (roadblocktimer != 0) return SendClientMessage(playerid, COLOR_GREY, "Please wait before trying to spawn another roadblock!");

new Float:X, Float:Y, Float:Z, Float:A;

GetPlayerPos(playerid, X, Y, Z);

GetPlayerFacingAngle(playerid, A);

PlayerInfo[playerid][pRoadblock] = CreateObject(981, X, Y, Z, 0.0, 0.0, A+180);

SetPlayerPos(playerid, X, Y, Z+4);

GameTextForPlayer(playerid, "~w~Roadblock ~r~Placed", 5000, 5);

SendClientMessage(playerid, COLOR_GREEN, "Roadblock deployed successfully, type /rrb or /roadunblock to remove it.");

roadblocktimer = 1;

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "HQ: A roadblock has been deployed by %s.", sendername);

for(new i = 0; i < MAX_PLAYERS; i++)

{

if(IsPlayerConnected(i))

{

if(PlayerInfo[pMember] == 1 || PlayerInfo[pLeader] == 1 || PlayerInfo[pAdmin] == 1338 || PlayerInfo[pAdmin] == 1339 )

{

//SetPlayerCheckpoint(playerid, X, Y, Z-10, 1.0);

SendClientMessage(i, TEAM_BLUE_COLOR, string);

if (PlayerInfo[pRank] >= 5 && PlayerInfo[pMember] || PlayerInfo[pLeader] == 1)

{

SendClientMessage(i, COLOR_YELLOW, "You can remove all roadblocks by typing /rrball");

}

}

}

}

SetTimer("ResetRoadblockTimer", 60000, false);

return 1;

}[/pawn]

7 answers to this question

Recommended Posts

Posted

Ia pune asa

#if !defined foreach
						#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))

 

1859311972_BANNER-GIREADAcopy-min.thumb.png.48e5e420ae2185dce5b244965a1d2601.png

 

Posted

gf.pwn(62654) : error 001: expected token: "#endif", but found "-end of file-"

Am rezolvat cu foreach acuma cu /rb de la PD , de ce nu se vad?

Posted

Acuma am schimbat si e pe dos am pus din nou /rb si cand dau /rb nu apare dar cand dau /rrball (removeroadblockall) imi apare :)) ce naiba sa mai fac

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.