[INC] Keypad & player list [0.3e]
Player list:
Функции:
Code
native InputFromPlayerList(playerid, event, bool:allowcancel);
forward OnPlayerSelectPlayer(playerid, targetid, event);
Пример:
Code
#define EVENT_BAN 1
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/ban", true))
{
InputFromPlayerList(playerid, EVENT_BAN, true);
return 1;
}
return 0;
}
public OnPlayerSelectPlayer(playerid, targetid, event)
{
if(event == EVENT_BAN && targetid != INVALID_PLAYER_ID)
{
Ban(targetid);
}
}
Keypad:
Функции:
Code
native InputFromKeypad(playerid, event, len, bool:allowcancel);
forward OnPlayerKeypadInput(playerid, input, event);
Пример:
Code
#define EVENT_SETHP 2
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/ban", true))
{
InputFromPlayerList(playerid, EVENT_SETHP, true);
return 1;
}
return 0;
}
public OnPlayerKeypadInput(playerid, input, event)
{
if(event == EVENT_SETHP)
{
SetPlayerHealth(playerid, float(input));
}
}
Автор: Hiddos
Скачать: ФА