SA-MP Forums Archive
A little attempt - 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: A little attempt (/showthread.php?tid=119901)



A little attempt - TheGtaLover - 09.01.2010

Well, I tried to make a /pduty command for officers..
Code:
if(strcmp(cmd, "/pduty", true) == 0)
{
if(PlayerToPoint(3, playerid,303.8969,-141.7608,1004.0625);
}
if(PlayerInfo[playerid][pSmember] != 11)
{
SendClientMessage(playerid, COLOR_GRAD1, "Police Officers only!");
return 1;
}
PlayerInfo[playerid][pTeam] = level;
SendTeamMessage(2, TEAM_BLUE_COLOR, "Officer %s has gone on duty", sendername);
return 1;
}
and Pawno Libary stops working.. and I dont know..? Any help?


Re: A little attempt - CJ101 - 09.01.2010

Code:
if(strcmp(cmd, "/pduty", true) == 0)
{
if(PlayerToPoint(3, playerid,303.8969,-141.7608,1004.0625);
 {
  if(PlayerInfo[playerid][pSmember] != 11) return SendClientMessage(playerid, COLOR_GRAD1, "Police Officers only!");
  PlayerInfo[playerid][pTeam] = level;
  SendTeamMessage(2, TEAM_BLUE_COLOR, "Officer %s has gone on duty", sendername);
  return 1;
 }
}



Re: A little attempt - s0nic - 09.01.2010

Here you go..? Tho what does " PlayerInfo[playerid][pTeam] = level; " exactly do..set there team# to there lvl?
Shouldnt you make it set there duty status instead of there team?
pawn Code:
if(strcmp(cmd, "/pduty", true) == 0)
{
    if(PlayerToPoint(3, playerid,303.8969,-141.7608,1004.0625)
    {
        if(PlayerInfo[playerid][pSmember] != 11) return SendClientMessage(playerid, COLOR_GRAD1, "Police Officers only!");
        PlayerInfo[playerid][pTeam] = level;
        SendTeamMessage(2, TEAM_BLUE_COLOR, "Officer %s has gone on duty", sendername);
    }
    return 1;
}



Re: A little attempt - s0nic - 09.01.2010

Quote:
Originally Posted by Seif_
Learn to indent your code and this will never happen.
Yea..that too, tho it might have been the code tags..and then again he had a semicolon on his p2p check..