Команда поможет сменить работу игрока.
Переменная new kisel;
И код:
Переменная new kisel;
И код:
Код:
if(strcmp(cmd, "/setjob", true) == 0)
{
if(Offlineonline(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "* Используйте /setjob [ID] [ид работы]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "* Используйте /setjob [ID] [работко]");
return 1;
}
kisel = strval(tmp);
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "* Вы не админ");
return 1;
}
if(kisel < 1 || kisel > 200)
{
SendClientMessage(playerid, COLOR_GRAD1, "* Нету такой работы");
return 1;
}
if (Offlineonline(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
SendClientMessage(playerid, COLOR_RED, "Вы сменили работу");
PlayerInfo[giveplayerid][pJob] = kisel;
}
}
else
{
format(string, sizeof(string), " %d ето не активный игрок.", giveplayerid);
SendClientMessage(playerid, COLOR_GRAD1, string);
}
}
return 1;
}