Hello need help with cmd!
#1

Код:
CMD:duty(playerid, params[]) {
 	if(IsPlayerConnected(playerid))
	{
		if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroupRank] >= 4)
		{
			if (PlayerToPoint(3, playerid,263.8386,109.0965,1004.6172) || PlayerToPoint(3, playerid,263.8386,109.0965,1004.6172) || PlayerInfo[playerid][pLocal] != 255) //this is error line!
			{
    			ShowPlayerDialog(playerid, DUTYMENU, DIALOG_STYLE_LIST, "LSPD Menu","Duty\nWeapons\nSWAT\nUniform\nUndercover", "Select", "Cancel");
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD2, "   You are not in a locker room !");
				return 1;
			}
		}
   		if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroupRank] >= 4)
		{
			if(OnDuty[playerid]==0)
			{
				format(string, sizeof(string), "* EMT %s took a Badge from his bag.", sendername);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				GivePlayerWeapon(playerid, 42, 1000000);
				OnDuty[playerid] = 1;
			}
			else if(OnDuty[playerid]==1)
			{
				format(string, sizeof(string), "* EMT %s places his Badge in his bag.", sendername);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				OnDuty[playerid] = 0;
			}
		}
		else
		{
   			SendClientMessage(playerid, COLOR_GRAD1, "   You are not a Cop or EMT!");
		}
	}
	return 1;
}
error:
Код:
error 017: undefined symbol "PlayerToPoint"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#2

pawn Код:
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        tempposx = (oldposx -x);
        tempposy = (oldposy -y);
        tempposz = (oldposz -z);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
Reply
#3

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Native function.
Reply
#4

It's cmd not just player to the point man....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)