31.01.2010, 08:54
I have commands!
For commands /bar i need the message you not in bar
For command /drugs you not in drug house
For commands /bar i need the message you not in bar
For command /drugs you not in drug house
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/kill", cmdtext, true, 10) == 0) { SetPlayerHealth(playerid, 0); return 1; } if(!strcmp("/bar", cmdtext, true) && PlayerToPoint(1.5,playerid,497.4167,-75.4108,998.7578)) { ShowPlayerDialog(playerid, 50, DIALOG_STYLE_LIST, "Что желаем?", "Напиток ($1)\nПиво ($2)\nВино ($3)\nСигара ($5)", "Купить", "Уйти"); return 1; } if(!strcmp("/bar", cmdtext, true) && PlayerToPoint(1.5,playerid,498.9911,-20.6630,1000.6797)) { ShowPlayerDialog(playerid, 50, DIALOG_STYLE_LIST, "Что желаем?", "Напиток ($1)\nПиво ($2)\nВино ($3)\nСигара ($5)", "Купить", "Уйти"); return 1; } if(!strcmp("/drugs", cmdtext, true) && PlayerToPoint(1.5,playerid,323.7905,1120.0074,1083.8828)) { ShowPlayerDialog(playerid, 51, DIALOG_STYLE_LIST, "Что будем принимать?", "Травка ($50)\nКокс ($200)", "Купить", "Уйти"); return 1; } if(strcmp(cmdtext, "/tabletka", true) == 0) { SetPlayerWeather(playerid, 10); SetPlayerDrunkLevel(playerid, 2000); SendClientMessage(playerid, 0x00C0C0AA, "Тебе помогла таблетка..."); return 1; } if(!strcmp("/heal", cmdtext, true) && PlayerToPoint(1.5,playerid,2033.8627,-1404.4601,17.2588)) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid, 0x00C0C0AA, "Тебя вылечили."); return 1; } return 0; }