PlayerToPoint Errors
#1

I know its not player to point but some is wrong with this code can anyeone tell me
Код:
  if(strcmp(cmd, "/locker", true) == 0)
  {
		if(IsPlayerConnected(playerid))
    {
		  new x_nr[256];
		  x_nr = strtok(cmdtext, idx);
  		  if(!strlen(x_nr))
  		  {
       new gunname1[100];
       if(PlayerInfo[playerid][pLockerWeapon] != 0) { GetWeaponName(PlayerInfo[playerid][pLockerWeapon], gunname1, sizeof(gunname1));} else { gunname1 = "Empty"; }
       new gunname2[100];
       if(PlayerInfo[playerid][pLockerWeapon2] != 0) { GetWeaponName(PlayerInfo[playerid][pLockerWeapon2], gunname2, sizeof(gunname2));} else { gunname2 = "Empty"; }
       new gunname3[100];
       if(PlayerInfo[playerid][pLockerWeapon3] != 0) { GetWeaponName(PlayerInfo[playerid][pLockerWeapon3], gunname3, sizeof(gunname3));} else { gunname3 = "Empty"; }
       new gunname4[100];
       if(PlayerInfo[playerid][pLockerWeapon4] != 0) { GetWeaponName(PlayerInfo[playerid][pLockerWeapon4], gunname4, sizeof(gunname4));} else { gunname4 = "Empty"; }
       new gunname5[100];
       if(PlayerInfo[playerid][pLockerWeapon5] != 0) { GetWeaponName(PlayerInfo[playerid][pLockerWeapon5], gunname5, sizeof(gunname5));} else { gunname5 = "Empty"; }
       SendClientMessage(playerid, COLOR_WHITE, "|-----------Storage Locker----------|");
      	 format(string, sizeof(string), "|Slot 1| %s", gunname1);
      	 SendClientMessage(playerid, COLOR_GRAD3, string);
      	 format(string, sizeof(string), "|Slot 2| %s", gunname2);
      	 SendClientMessage(playerid, COLOR_GRAD3, string);
      	 format(string, sizeof(string), "|Slot 3| %s", gunname3);
      	 SendClientMessage(playerid, COLOR_GRAD3, string);
      	 format(string, sizeof(string), "|Slot 4| %s", gunname4);
      	 SendClientMessage(playerid, COLOR_GRAD3, string);
			 format(string, sizeof(string), "|Slot 5| %s", gunname5);
 			 SendClientMessage(playerid, COLOR_GRAD3, string);
			 SendClientMessage(playerid, COLOR_GRAD6, "|-------------------------------------------|");
       SendClientMessage(playerid, COLOR_GRAD3, "USAGE: /locker [store|take]");
			 return 1;
			 }
			 if(strcmp(x_nr,"store",true) == 0)
  		 {
       x_nr = strtok(cmdtext, idx);
			 if(!strlen(x_nr))
			 {
			  SendClientMessage(playerid, COLOR_WHITE,"USAGE: /locker store [gun|pot|crack|mats]");
			  return 1;
			 }
			 if(strcmp(x_nr,"gun",true) == 0)
			 {
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /locker store gun {slot}");
				return 1;
			 }
			 if(strcmp(x_nr,"1",true) == 0)
			 {
				if(PlayerInfo[playerid][ppLockerWeapon] != 0) return SendClientMessage(playerid, COLOR_GREY, " You have placed something on slot 1 already !");
				new gunname[100];
     		PlayerInfo[playerid][ppLockerWeapon] = gunID;
		    RemovePlayerWeapon(playerid, gunID);
  			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				GetWeaponName(gunID, gunname, sizeof(gunname));
        	format(string, sizeof(string), "* %s puts a %s in their locker.", sendername,gunname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	      format(string, sizeof(string), "  You put an %s in your locker.", gunname);
				SendClientMessage(playerid, COLOR_GREY, string);
				return 1;
			}
			else if(strcmp(x_nr,"2",true) == 0)
			{
				if(PlayerInfo[playerid][ppLockerWeapon2] != 0) return SendClientMessage(playerid, COLOR_GREY, " You have placed something on slot 2 already !");
				new gunname[100];
   			PlayerInfo[playerid][ppLockerWeapon2] = gunID;
				RemovePlayerWeapon(playerid, gunID);
  			PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				GetWeaponName(gunID, gunname, sizeof(gunname));
        	format(string, sizeof(string), "* %s puts a %s in their locker.", sendername,gunname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	      format(string, sizeof(string), "  You put an %s in your locker.", gunname);
		 		SendClientMessage(playerid, COLOR_GREY, string);
				return 1;
			}
			else if(strcmp(x_nr,"3",true) == 0)
			{
				if(PlayerInfo[playerid][ppLockerWeapon3] != 0) return SendClientMessage(playerid, COLOR_GREY, " You have placed something on slot 3 already !");
				new gunname[100];
				PlayerInfo[playerid][ppLockerWeapon3] = gunID;
				RemovePlayerWeapon(playerid, gunID);
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				GetWeaponName(gunID, gunname, sizeof(gunname));
				format(string, sizeof(string), "* %s puts a %s in their locker.", sendername,gunname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				format(string, sizeof(string), "  You put an %s in your locker.", gunname);
				SendClientMessage(playerid, COLOR_GREY, string);
				return 1;
			}
			else if(strcmp(x_nr,"4",true) == 0)
			{
				if(PlayerInfo[playerid][ppLockerWeapon4] != 0) return SendClientMessage(playerid, COLOR_GREY, " You have placed something on slot 4 already !");
				new gunname[100];
				PlayerInfo[playerid][ppLockerWeapon4] = gunID;
				RemovePlayerWeapon(playerid, gunID);
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				GetWeaponName(gunID, gunname, sizeof(gunname));
				format(string, sizeof(string), "* %s puts a %s in their locker.", sendername,gunname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				format(string, sizeof(string), "  You put an %s in your locker.", gunname);
				SendClientMessage(playerid, COLOR_GREY, string);
				return 1;
			}
			else if(strcmp(x_nr,"5",true) == 0)
			{
				if(PlayerInfo[playerid][ppLockerWeapon5] != 0) return SendClientMessage(playerid, COLOR_GREY, " You have placed something on slot 5 already !");
				new gunname[100];
   			PlayerInfo[playerid][ppLockerWeapon5] = gunID;
				RemovePlayerWeapon(playerid, gunID);
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				GetPlayerName(playerid, sendername, sizeof(sendername));
				GetWeaponName(gunID, gunname, sizeof(gunname));
				format(string, sizeof(string), "* %s puts a %s in their locker.", sendername,gunname);
				ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
				format(string, sizeof(string), "  You put an %s in your locker.", gunname);
				SendClientMessage(playerid, COLOR_GREY, string);
				return 1;
			}
		}
		return 1;
	}
Reply
#2

https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)