BigeAR
Дебютант
Привет всем,не могу понять почему "игроки" без админки могут менять скин и тпшится без админки
Команда /goto:
Команда /skin:
Помогите
Команда /goto:
PHP:
if(strcmp(cmd, "/goto", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, RED, "USAGE: /goto [playerid/PartOfName]");
return 1;
}
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if (HeroInfo[playerid][pAdmin] >= 1)
{
GetPlayerPos(plo, plocx, plocy, plocz);
new intpla = GetPlayerInterior(plo);
new wvpla = GetPlayerVirtualWorld(plo);
if (GetPlayerState(playerid) == 2)
{
SetVehiclePos(GetPlayerVehicleID(playerid), plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(playerid,plocx,plocy+2, plocz);
}
SetPlayerInterior(playerid,intpla);
HeroInfo[playerid][pInt] = HeroInfo[plo][pInt];
HeroInfo[playerid][pVW] = HeroInfo[plo][pVW];
SetPlayerVirtualWorld(playerid, wvpla);
SendClientMessage(playerid, YELLOW, "*Âû áûëè òåëåïîðòèðîâàíû");
new playername[20];
new giveplayername[20];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(plo, giveplayername, sizeof(giveplayername));
format(string, sizeof(string), "Àäìèíèñòðàòîð %s òåëåïîðòèðîâàëñÿ ê %s.",playername, giveplayername);
SendAdminMessage(LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, RED, "*Âû íå ìîæåòå èñïîëüçîâàòü ýòó êîìàíäó!");
}
}
}
else
{
format(string, sizeof(string), "*%d òàêîãî èãðîêà íåò.", plo);
SendClientMessage(playerid, RED, string);
}
}
return 1;
}
PHP:
if(strcmp(cmd, "/skin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, RED, "Ïîäñêàçêà: /skin [IDèãðîêà] [ñêèí id]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
new level;
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 299 || level < 1) { SendClientMessage(playerid, RED, "Íåïðàâèëüíûé ID ñêèíà!"); return 1; }
if (HeroInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
HeroInfo[para1][pSkin] = level;
format(string, sizeof(string), "Àäìèí %s èçìåíèë òâîé ñêèí", sendername);
SendClientMessage(para1, GREEN, string);
format(string, sizeof(string), "Âû èçìåíèëè ñêèí %s íà %d", giveplayer, level);
SendClientMessage(playerid, GREEN, string);
SetPlayerSkin(para1, HeroInfo[para1][pSkin]);
SaveHero(para1);
}
}
}
else
{
SendClientMessage(playerid, RED, "Òû íå àâòîðèçîâàí äëÿ èñïîëüçîâàíèÿ ýòîé êîìàíäû!");
}
}
return 1;
}
Помогите
