Quote (maximal115)
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminbase", cmdtext, true, 10) == 0)
{
#if(IsPlayerAdmin(playerid)) // вот где проблема
SetPlayerPos(playerid,-11.981010437012, -334.7995300293, 5.9296875);
GivePlayerWeapon(playerid, 38, 10000);
GivePlayerWeapon(playerid, 23,6000);
GivePlayerWeapon(playerid, 26,6000);
GivePlayerWeapon(playerid, 32,6000);
GivePlayerWeapon(playerid, 39,100);
GivePlayerWeapon(playerid, 31,6000);
#else
SendClientMessage(playerid, COLOR_GREEN, "Fuck You,It's My Base! :)");
#endif
return 1;
}
всё что начинается с # - обращения к компилятору,а нам в данном случае нужно проверить конкретного игрока на админство,тут компилятор идёт лесом и делает своё дело по тихому:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/adminbase", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid))
{
SetPlayerPos(playerid,-11.981010437012, -334.7995300293, 5.9296875);
GivePlayerWeapon(playerid, 38, 10000);
GivePlayerWeapon(playerid, 23,6000);
GivePlayerWeapon(playerid, 26,6000);
GivePlayerWeapon(playerid, 32,6000);
GivePlayerWeapon(playerid, 39,100);
GivePlayerWeapon(playerid, 31,6000);
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "Fuck You,It's My Base! :)");
}
return 1;
}