Small Help || Missplaced Bracket - 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: Small Help || Missplaced Bracket (
/showthread.php?tid=257169)
Small Help || Missplaced Bracket -
up2u - 24.05.2011
Код:
//=================/spgate=================//
if(strcmp(cmd, "/spgate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pJob] == 30 || PlayerInfo[playerid][pJob] == 31)
{
{
SendClientMessage(playerid, COLOR_WHITE, "You have placed a Adm Gate, /sprgate to Remove All Adm Gates.");
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid,A);
if(PlayerInfo[playerid][pJob] == 30)
{
RoadBlocksAdmin++;
RoadBlockObject[RoadBlocksAdmin] = CreateObject(974, X, Y+1, Z, 0, 0, A);
}
else
{
RoadBlocksAdmin++;
RoadBlockObjectFBI[RoadBlocksAdmin] = CreateObject(974, X, Y+1, Z, 0, 0, A);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You rank is to low to set a Road Block !");
return 1;
}
}
}
return 1;
}
if(strcmp(cmd, "/sprgate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pJob] == 30 || PlayerInfo[playerid][pJob] == 31)
{
{
SendClientMessage(playerid, COLOR_WHITE, "All Adm Gates destroyed..");
for(new o = 0; o < MAX_OBJECTS; o++)
{
if(PlayerInfo[playerid][pJob] ==30)
{
DestroyObject(RoadBlockObjectAdmin[o]);
RoadBlocksAdmin = 0;
}
else
{
DestroyObject(RoadBlockObjectAdmin[o]);
RoadBlocksAdmin = 0;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not allowed to create a Adm Gate !");
return 1;
}
}
}
return 1;
}
Above the first SendClientMessage there first was:
Код:
if (PlayerInfo[playerid][pRank] > 1)
{
But i had to remove that, I didnt know what to do with the bracked it first had so i just left it there, If i remove it Pawno Crashed.
(PS: Same Problem for the second command)
Re: Small Help || Missplaced Bracket -
[DM]Kane - 24.05.2011
Check this one:
pawn Код:
//=================/spgate=================//
if(strcmp(cmd, "/spgate", true) == 0)
{
if(IsPlayerConnected(playerid)
{
if (PlayerInfo[playerid][pJob] == 30 || PlayerInfo[playerid][pJob] == 31)
{
SendClientMessage(playerid, COLOR_WHITE, "You have placed a Adm Gate, /sprgate to Remove All Adm Gates.");
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid,A);
if(PlayerInfo[playerid][pJob] == 30)
{
RoadBlocksAdmin++;
RoadBlockObject[RoadBlocksAdmin] = CreateObject(974, X, Y+1, Z, 0, 0, A);
}
else
{
RoadBlocksAdmin++;
RoadBlockObjectFBI[RoadBlocksAdmin] = CreateObject(974, X, Y+1, Z, 0, 0, A);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You rank is to low to set a Road Block !");
return 1;
}
return 1;
}
}
if(strcmp(cmd, "/sprgate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pJob] == 30 || PlayerInfo[playerid][pJob] == 31)
{
SendClientMessage(playerid, COLOR_WHITE, "All Adm Gates destroyed..");
for(new o = 0; o < MAX_OBJECTS; o++)
{
if(PlayerInfo[playerid][pJob] ==30)
{
DestroyObject(RoadBlockObjectAdmin[o]);
RoadBlocksAdmin = 0;
}
else
{
DestroyObject(RoadBlockObjectAdmin[o]);
RoadBlocksAdmin = 0;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not allowed to create a Adm Gate !");
return 1;
}
}
return 1;
}