DeimoS (23 февраля 2021 - 11:04) писал:
Нажмите сюда, чтобы прочитать это сообщение. [Показать]
Спасибо просто копировать не буду буду сидеть и понимать
DeimoS (23 февраля 2021 - 18:09) писал:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/book", true, 5) == 0 && cmdtext[5] == ' ') { if(!GetPVarType(playerid, "PlayerReadBook")) { new Float:x; new Float:y; new Float:z; GetPlayerPos(playerid, x, y, z); new string[144+1]; GetPlayerName(playerid, string, MAX_PLAYER_NAME); format(string, sizeof(string), "%s читает %s", string, cmdtext[6]); for(new i; i < MAX_PLAYERS; i++) { if(!IsPlayerInRangeOfPoint(i, 10.0, x, y, z)) { continue; } SendClientMessage(i, 0xFFFFFFFF, string); } SetPVarInt(playerid, "PlayerReadBook", 1); ApplyAnimation(playerid, "PED", "BOMBER", 4.1, true, false, false, false, 0, true); } else { SendClientMessage(playerid, 0xFFFFFFFF, "Вы прекратили читать книгу"); DeletePVar(playerid, "PlayerReadBook"); ClearAnimations(playerid, true); } return 1; } return 1; }
Сообщение отредактировал BroGames: 23 февраля 2021 - 18:16
if(strcmp(cmdtext, "/book", true, 5) == 0 && (cmdtext[5] == ' ' || cmdtext[5] == '\0')) { if(!GetPVarType(playerid, "PlayerReadBook")) { if(cmdtext[5] == '\0') { SendClientMessage(playerid, 0xFFFFFFFF, "Используйте: /book \"Название книги, которую читаете\""); return 1; } new Float:x; new Float:y; new Float:z; GetPlayerPos(playerid, x, y, z); new string[144+1]; GetPlayerName(playerid, string, MAX_PLAYER_NAME); format(string, sizeof(string), "%s читает %s", string, cmdtext[6]); for(new i; i < MAX_PLAYERS; i++) { if(!IsPlayerInRangeOfPoint(i, 10.0, x, y, z)) { continue; } SendClientMessage(i, 0xFFFFFFFF, string); } SetPVarInt(playerid, "PlayerReadBook", 1); ApplyAnimation(playerid, "PED", "BOMBER", 4.1, true, false, false, false, 0, true); } else { SendClientMessage(playerid, 0xFFFFFFFF, "Вы прекратили читать книгу"); DeletePVar(playerid, "PlayerReadBook"); ClearAnimations(playerid, true); } return 1; }
CMD:book(playerid, params[]) { if(GetPVarType(playerid, "PlayerReadBook") == PLAYER_VARTYPE_INT) { SendClientMessage(playerid, 0xFFFFFFFF, "Вы прекратили читать книгу"); DeletePVar(playerid, "PlayerReadBook"); ClearAnimations(playerid, true); return 1; } if(isnull(params)) { SendClientMessage(playerid, 0xFFFFFFFF, "Используйте: /book \"Название книги, которую читаете\""); return 1; } new Float:x; new Float:y; new Float:z; GetPlayerPos(playerid, x, y, z); new string[144+1]; GetPlayerName(playerid, string, MAX_PLAYER_NAME); format(string, sizeof(string), "%s читает %s", string, cmdtext[6]); for(new i; i < MAX_PLAYERS; i++) { if(!IsPlayerInRangeOfPoint(i, 10.0, x, y, z)) { continue; } SendClientMessage(i, 0xFFFFFFFF, string); } SetPVarInt(playerid, "PlayerReadBook", 1); ApplyAnimation(playerid, "PED", "BOMBER", 4.1, true, false, false, false, 0, true); return 1; }
Сообщение отредактировал DeimoS: 23 февраля 2021 - 18:33
DeimoS (23 февраля 2021 - 18:32) писал:
DeimoS (23 февраля 2021 - 18:32) писал:
Цитата
Сообщение отредактировал BroGames: 23 февраля 2021 - 21:27