14.09.2009, 18:41
pawn Код:
if(strcmp(cmd, "/giveweaponlicense", true) == 0 || strcmp(cmd, "/gwl", true) == 0)
{
printf("<-[DEBUG]->: Passed GWL 1");
giveplayerid = ReturnUser(tmp);
printf("<-[DEBUG]->: Passed GWL 2");
if(IsPlayerConnected(playerid))
{
printf("<-[DEBUG]->: Passed GWL 3");
if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
printf("<-[DEBUG]->: Passed GWL 4");
if(giveplayerid != INVALID_PLAYER_ID)
{
printf("<-[DEBUG]->: Passed GWL 5");
new Float:x, Float:y, Float:z;
printf("<-[DEBUG]->: Passed GWL 6");
GetPlayerPos(giveplayerid,x,y,z);
printf("<-[DEBUG]->: Passed GWL 7");
if(PlayerInfo[playerid][pRank] < 2)
{
printf("<-[DEBUG]->: Passed GWL 8");
SendClientMessage(playerid, COLOR_GRAD1, " You need to be Rank 2 to give license!");
return 1;
}
if(!PlayerToPoint(15, playerid, x, y, z))
{
printf("<-[DEBUG]->: Passed GWL 9");
SendClientMessage(playerid, COLOR_GRAD1, " Player is not near you!");
printf("<-[DEBUG]->: Passed GWL ");
return 1;
}
if(PlayerInfo[giveplayerid][pGunLic] == 1)
{
printf("<-[DEBUG]->: Passed GWL 10");
SendClientMessage(playerid, COLOR_GRAD1, " Player already haves weapon license.");
printf("<-[DEBUG]->: Passed GWL 11");
return 1;
}
printf("<-[DEBUG]->: Passed GWL 12");
PlayerInfo[giveplayerid][pGunLic] = 1;
printf("<-[DEBUG]->: Passed GWL 13");
GetPlayerName(playerid, sendername, sizeof(sendername));
printf("<-[DEBUG]->: Passed GWL 14");
format(string, sizeof(string), "* Officer %s gave you Weapons License.", sendername);
printf("<-[DEBUG]->: Passed GWL 15");
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
printf("<-[DEBUG]->: Passed GWL 16");
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
printf("<-[DEBUG]->: Passed GWL 17");
format(string, sizeof(string), "* You gave Weapons License to %s.",giveplayerid);
printf("<-[DEBUG]->: Passed GWL 18");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
printf("<-[DEBUG]->: Passed GWL 19");
}
}
else
{
printf("<-[DEBUG]->: Passed GWL 20 FINAL!");
SendClientMessage(playerid, COLOR_GRAD1, " You are not Cop!");
return 1;
}
}
return 1;
}