11.06.2012, 21:57
Error
cmd
Код:
../gamemodes/OnPlayerCommandZCMD.pwn(3485) : warning 209: function "cmd_givegunlicense" should return a value ../gamemodes/OnPlayerCommandZCMD.pwn(3486) : error 010: invalid function or declaration ../gamemodes/OnPlayerCommandZCMD.pwn(3491) : error 010: invalid function or declaration ../gamemodes/OnPlayerCommandZCMD.pwn(3698) : error 029: invalid expression, assumed zero
pawn Код:
}
CMD:givegunlicense(playerid, params[])
{
new targetid;
if(sscanf(params, "us[128]", targetid)) SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /giveweaponlicense [playerid/partofname]");
if (playerid == targetid) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You cannot blind yourself.");
if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
if (PlayerCuffed[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You cannot do while cuffed");
if (PlayerTazed[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You cannot do while tazed");
if (PlayerTied[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "SERVER: You cannot do while tied");
if (Died[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: Cannot use this command while dead.");
if(PlayerInfo[playerid][pFaction] == 1 && PlayerInfo[playerid][pRank] <= 2 || PlayerInfo[playerid][pAdministrator] > 0)
{
new Float:NearYou[3];
GetPlayerPos(giveplayerid, NearYou[0], NearYou[1], NearYou[2]);
if(!IsPlayerInRangeOfPoint(playerid, 1.0, NearYou[0], NearYou[1], NearYou[2])) //1.0 is the range, try changing it if you don't like 1.0
{
SendClientMessage(playerid,-1,"You must be near the player!");
return 1;
}
if(giveplayerid != INVALID_PLAYER_ID)
{
new wep1[128];
PlayerInfo[giveplayerid][pWepLic] = 1;
format(wep1, sizeof(wep1), "gives %s a weapon license.",GetPlayerNameEx(giveplayerid));
PlayerActionMessage(playerid,15.0,wep1);
new give1[128];
format(give1, sizeof(give1), "You have given %s a weapon license.", GetPlayerNameEx(giveplayerid));
SendClientMessage(playerid, COLOR_WHITE, give1);
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
}
}
return 1;