24.10.2018, 15:48
PHP код:
CMD:toggle(playerid, params[])
{
new settings[24];
if(sscanf(params, "s[24]", settings)) return SendClientMessage(playerid, -1, "Use /toggle (PM, TesterChat, AdminChat, Radio)");
if(!strcmp(settings, "pm", true))
{
if(pInfo[playerid][pPM] == 1)
{
pInfo[playerid][pPM] = 0;
SendClientMessage(playerid, -1, ""COL_LGREEN" Now you get PMs.");
}
else
{
pInfo[playerid][pPM] = 1;
SendClientMessage(playerid, -1, ""COL_LGREEN" Now you don't get PMs.");
}
return 1;
}
else if(!strcmp(settings, "testerchat", true))
{
if(pInfo[playerid][tChat] == 1)
{
pInfo[playerid][tChat] = 0;
SendClientMessage(playerid, -1,""COL_LGREEN" Activatedl.");
}
else
{
pInfo[playerid][tChat] = 1;
SendClientMessage(playerid, -1,""COL_LGREEN" not");
}
return 1;
}
else if(!strcmp(settings, "adminchat", true))
{
if(pInfo[playerid][aChat] == 1)
{
pInfo[playerid][aChat] = 0;
SendClientMessage(playerid, -1,""COL_LGREEN" Yes.");
}
else
{
pInfo[playerid][aChat] = 1;
SendClientMessage(playerid, -1,""COL_LGREEN" Not");
}
return 1;
}
else if(!strcmp(settings, "radio", true))
{
new str[MAX_PLAYER_NAME+10];
if(pInfo[playerid][rChat] == 1)
{
pInfo[playerid][rChat] = 0;
format(str, sizeof(str), "* %s yes.", PlayerName(playerid));
ProxDetector(30, playerid, str, COLOR_PURPLE);
}
else
{
pInfo[playerid][rChat] = 1;
format(str, sizeof(str), "* %s not.", PlayerName(playerid));
ProxDetector(30, playerid, str, COLOR_PURPLE);
}
return 1;
}
else SendClientMessage(playerid, -1, "Use /toggle (PM, TesterChat, AdminChat, Radio)");
return 1;
}