if (strcmp("/check", cmdtext, true, 5) == 0) { new str[256], pname[256]; if(PlayerInfo[playerid][pRank] < 1) return SendClientMessage(playerid,0xFF0000FF, "Identification Error - You need LAE Rank 1 to do this."); if(GetPlayerTeam(playerid) != 5) return SendClientMessage(playerid,0xFF0000FF, "Identification Error - You are not a Police Officer."); GetPlayerName(playerid, pname, 256); format(str, 256, "Officer %s Checks him/her for any illegal items!", pname, cmdtext[7]); SendClientMessageToAll(COLOR_BLUE, str); return 1; }
if(strcmp(cmd, "/jail", true) == 0) { if(PlayerToPoint(25.0,playerid,268.3492,77.7623,1001.0391)) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [time(minutes)]"); return 1; } new playa; new money; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); money = strval(tmp); if (GetPlayerTeam(playerid)==5) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "You Jailed %s.", giveplayer); SendClientMessage(playerid, COLOR_BLUE, string); format(string, sizeof(string), "You were Jailed by %s.", sendername); SendClientMessage(playa, COLOR_BLUE, string); ResetPlayerWeapons(playa); //WantedLevel[playa] = 0; PlayerInfo[playa][pJailed] = 2; PlayerInfo[playa][pJailTime] = money*60; SetPlayerInterior(playa, 6); SetPlayerPos(playa, 264.6288,77.5742,1001.0391); format(string, sizeof(string), "You are jailed for %d minutes.", money); SendClientMessage(playa, COLOR_BLUE, string); } } } else { SendClientMessage(playerid, COLOR_RED, "Identification Error - You need LAE Rank 1 to do this."); } } } else { SendClientMessage(playerid, COLOR_RED, "You are not at the cells"); } return 1; } return 0; }
if(PlayerInfo[playerid][pRank] == 1)
{
//ur hailfunction
}
else
SendClientMessage(playerid,0xFF0000FF, "Identification Error - Blah");
Originally Posted by saiberfun
do
pawn Код:
![]() |
if(strcmp(cmd, "/jail", true) == 0)
{
if(PlayerInfo[playerid][pRank] >= 1)
}
if(PlayerToPoint(25.0,playerid,268.3492,77.7623,1001.0391))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [time(minutes)]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (GetPlayerTeam(playerid)==5)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "You Jailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "You were Jailed by %s.", sendername);
SendClientMessage(playa, COLOR_BLUE, string);
ResetPlayerWeapons(playa);
//WantedLevel[playa] = 0;
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 6);
SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
format(string, sizeof(string), "You are jailed for %d minutes.", money);
SendClientMessage(playa, COLOR_BLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Identification Error - You need LAE Rank 1 to do this.");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not at the cells");
}
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "You must be rank 1 to use this command");
}
Originally Posted by еddy
Don't forget to return. :P
|
invalid expression, assumed zero
expected token: ";", but found "if"
invalid function or declaration
if(strcmp(cmd, "/jail", true) == 0) { if(PlayerInfo[playerid][pRank] >= 1) } if(PlayerToPoint(25.0,playerid,268.3492,77.7623,1001.0391)) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [time(minutes)]"); return 1; } new playa; new money; playa = ReturnUser(tmp); tmp = strtok(cmdtext, idx); money = strval(tmp); if (GetPlayerTeam(playerid)==5) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "You Jailed %s.", giveplayer); SendClientMessage(playerid, COLOR_BLUE, string); format(string, sizeof(string), "You were Jailed by %s.", sendername); SendClientMessage(playa, COLOR_BLUE, string); ResetPlayerWeapons(playa); //WantedLevel[playa] = 0; PlayerInfo[playa][pJailed] = 2; PlayerInfo[playa][pJailTime] = money*60; SetPlayerInterior(playa, 6); SetPlayerPos(playa, 264.6288,77.5742,1001.0391); format(string, sizeof(string), "You are jailed for %d minutes.", money); SendClientMessage(playa, COLOR_BLUE, string); } } } else { SendClientMessage(playerid, COLOR_RED, "Identification Error - You need LAE Rank 1 to do this."); } } } else { SendClientMessage(playerid, COLOR_RED, "You are not at the cells"); } return 1; } else return SendClientMessage(playerid, COLOR_RED, "You must be rank 1 to use this command"); } return 0; }
if(strcmp(cmd, "/jail", true) == 0)
{
if(PlayerInfo[playerid][pRank] >= 1)
{
if(PlayerToPoint(25.0,playerid,268.3492,77.7623,1001.0391))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jail [playerid/PartOfName] [time(minutes)]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (GetPlayerTeam(playerid)==5)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "You Jailed %s.", giveplayer);
SendClientMessage(playerid, COLOR_BLUE, string);
format(string, sizeof(string), "You were Jailed by %s.", sendername);
SendClientMessage(playa, COLOR_BLUE, string);
ResetPlayerWeapons(playa);
//WantedLevel[playa] = 0;
PlayerInfo[playa][pJailed] = 2;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 6);
SetPlayerPos(playa, 264.6288,77.5742,1001.0391);
format(string, sizeof(string), "You are jailed for %d minutes.", money);
SendClientMessage(playa, COLOR_BLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Identification Error - You need LAE Rank 1 to do this.");
}
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not at the cells");
}
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "You must be rank 1 to use this command");
}
Originally Posted by еddy
Whoupsy, I failed. XD
Use this: pawn Код:
|