Problem with ProxDetectorS - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem with ProxDetectorS (
/showthread.php?tid=596133)
Problem with ProxDetectorS -
AlexuTzVs - 13.12.2015
Код:
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
Re: Problem with ProxDetectorS -
SoFahim - 13.12.2015
PHP код:
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)
{
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) || ProxDetectorS(30.0, i,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;
}
Try with it, also show your ProxDetectorS function
Re: Problem with ProxDetectorS -
AlexuTzVs - 13.12.2015
Not working, i have to write /eventskin 1 1 to change the skin to two players , i also have /eventheal the same command but is typing the message two times because there are two players..