Problem with ProxDetectorS
#1

Код:
if(strcmp(cmd, "/eventskin", true) == 0)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));

	    if(IsPlayerConnected(playerid))
	    {
	        for(new i = 0; i < MAX_PLAYERS; i ++)
	        if(PlayerInfo[i][pHelper] >= 2 || PlayerInfo[i][pAdmin] >= 1 || ProxDetectorS(30.0, i,i))
	        {
	            tmp = strtok(cmdtext, idx);
					if(!strlen(tmp))
					{
						SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /eventskin (1-4)");
						return 1;
					}
	            new nrs = strval(tmp);
	        	format(string, sizeof(string), "Admin %s has changed skin to everyone in 30 meters.", sendername);
	    		ProxDetector(30.0, playerid, string, COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED,COLOR_LIGHTRED);
				{
				    if(IsPlayerConnected(i))
				    {
				        {
				        if(nrs == 1)
				        {
					    SetPlayerSkin(i, 31);
					    SetPlayerColor(i, COLOR_GOLD);
					    }
					    if(nrs == 2)
					    {
					    SetPlayerSkin(i, 32);
					    SetPlayerColor(i, 0xFF40BFAA);
					    }
					    if(nrs == 3)
					    {
					    SetPlayerSkin(i, 33);
					    SetPlayerColor(i, 0xBFFF00AA);
					    }
					    if(nrs == 4)
					    {
					    SetPlayerSkin(i, 34);
					    SetPlayerColor(i, 0xFF8000AA);
					    }
						if(nrs < 1 || nrs > 4)
						{
						    SendClientMessage(playerid, COLOR_GRAD2, "Numarul trebuie sa fie intre 1 si 4.");
						    return 1;
						}
						}
					}
				}
			}
		}
		return 1;
	}
First time working with ProxDetectorS, i tried to make a command to change the skin to every person in 30 meters but when i use /eventskin 2 for example it changes to skin to the player next to me , it should change it to me and appear the message x changed the skin but after that USAGE: /eventskin [1-4] why... here is a photo
Reply


Messages In This Thread
Problem with ProxDetectorS - by AlexuTzVs - 13.12.2015, 01:54
Re: Problem with ProxDetectorS - by SoFahim - 13.12.2015, 03:11
Re: Problem with ProxDetectorS - by AlexuTzVs - 13.12.2015, 08:42

Forum Jump:


Users browsing this thread: 1 Guest(s)