public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new Message[256]; new AdMessage[256]; new idx; new actiontext[MAX_CHATBUBBLE_LENGTH+1]; new talktext[MAX_CHATBUBBLE_LENGTH+1]; new adtext[256]; cmd = strtok(cmdtext, idx); if(strcmp("/me", cmd, true) == 0) { Message = strrest(cmdtext,idx); new Playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, Playername, 24); format(actiontext,MAX_CHATBUBBLE_LENGTH,"*%s %s*",Playername, Message); SetPlayerChatBubble(playerid,actiontext,ACTION_COLOR,15.0,10000); SendClientMessage(playerid,ACTION_COLOR,actiontext); return 1; } if(strcmp("/l", cmd, true) == 0) { Message = strrest(cmdtext,idx); new Playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, Playername, 24); format(talktext,MAX_CHATBUBBLE_LENGTH,"%s says: %s",Playername, Message); SetPlayerChatBubble(playerid,talktext,MESSAGE_COLOR,20.0,10000); SendClientMessage(playerid,MESSAGE_COLOR,talktext); return 1; } if(strcmp("/advert", cmd, true) == 0) { if (PlayerInfo[playerid][pDonateRank] >= 3) if(PlayerInfo[playerid][pAdvert] <= 0) { PlayerInfo[playerid][pAdvert] = 10*60; } AdMessage = strrest(cmdtext,idx); new Playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, Playername, 24); format(adtext,256,"[Advert] %s by %s",AdMessage, Playername); SendClientMessageToAll(AD_COLOR,adtext); SendClientMessage(playerid, AD_COLOR, "Ти използва командата /advert и това ти струваше 50000$!"); GivePlayerMoney(playerid, -50000); return 1; } if (!strcmp(cmdtext, "/asay", true) || !strcmp(cmdtext, "/adminsay", true)) { if (PlayerInfo[playerid][pAdmin] >= 3) if(PlayerInfo[playerid][pHealme] <= 0) { PlayerInfo[playerid][pHealme] = 10*60; } ShowPlayerDialog(playerid, Asay, DIALOG_STYLE_INPUT, "{FF0000}- Admin Say", "{4F4F4F}Enter the text", "Say", "Cancel"); return 1; } if (strcmp("/buyscore", cmdtext, true, 10) == 0) { ShowPlayerDialog(playerid,9,DIALOG_STYLE_LIST,"Buy Score","{6EF83C}500 - Score - 50000000$\n {6EF83C}1000 Score - 100000000$\n {6EF83C}1500 Score - 150000000$\n{6EF83C}2000 Score - 150000000$","Select","Cancel"); return 1; } if (strcmp("/fshop", cmdtext, true, 10) == 0) if(IsPlayerInRangeOfPoint(playerid, 7.0, 763.1581,-50.1013,1000.5859)) { SendClientMessage(playerid,0xFFFFFFFF,""); ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Fighting Style List", "|-> Normal Fighting Styles\n|-> Boxing\n|-> Kungfu\n|-> KneeHead\n|-> GrabKick\n|-> Elbow", "Buy", "Close"); } if (strcmp("/ramping", cmdtext, true, 10) == 0) { if(Enabled[playerid] == 1) {SendClientMessage(playerid, 0xFFFF00FF, "Рампите са изключени!"); Enabled[playerid]=0; Pers[playerid]=0; return 1; } if(Enabled[playerid] == 0) { SendClientMessage(playerid, 0xFFFF00FF, "Рампите са включени!"); SendClientMessage(playerid, 0xFFFF00FF, "Използвайте Ctrl or Alt Gr за да създадете рампа!"); Enabled[playerid]=1; Pers[playerid]=1655; return 1; } } if (strcmp("/my ramp 1", cmdtext, true, 10) == 0) { if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Трябва първо да включите рампите! (/ramping)!"); SendClientMessage(playerid, 0xFFFF00FF, "Рампата е променена на вид 1!"); Pers[playerid]=1655; return 1; } if (strcmp("/my ramp 2", cmdtext, true, 10) == 0) { if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Трябва първо да включите рампите! (/ramping)!"); SendClientMessage(playerid, 0xFFFF00FF, "Рампата е променена на вид 2!"); Pers[playerid]=1632; return 1; } if (strcmp("/my ramp 3", cmdtext, true, 10) == 0) { if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Трябва първо да включите рампите! (/ramping)!"); SendClientMessage(playerid, 0xFFFF00FF, "Рампата е променена на вид 3!"); Pers[playerid]=1631; return 1; } if (strcmp("/my ramp 4", cmdtext, true, 10) == 0) { if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Трябва първо да включите рампите! (/ramping)!"); SendClientMessage(playerid, 0xFFFF00FF, "Рампата е променена на вид 4!"); Pers[playerid]=8302; return 1; } if (strcmp("/my ramp 5", cmdtext, true, 10) == 0) { if(Enabled[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Трябва първо да включите рампите! (/ramping)!"); SendClientMessage(playerid, 0xFFFF00FF, "Рампата е променена на вид 5!"); Pers[playerid]=1503; return 1; } if (strcmp("/my ramp", cmdtext, true, 10) == 0) { SendClientMessage(playerid, 0xFF0000FF, "Използвай: /my ramp [1-5]!"); return 1; } if (strcmp("/ramphelp", cmdtext, true, 10) == 0) { SendClientMessage(playerid, 0xFFFFFFFF, "• Използвай /ramping за да активираш рампите."); SendClientMessage(playerid, 0xFFFFFFFF, "• Изполвай /my ramp [1-5] за да смените типа на рампите."); SendClientMessage(playerid, 0xFFFFFFFF, "• За да създадете рампа използвайте ( ''Strg'' или ''Alt Gr'' )"); SendClientMessage(playerid, 0xFFFFFFFF, "• За да изключите рампите използвайте /ramping отново."); return 1; } if(strcmp("/c", cmdtext, true, 6) == 0) { if(blockspam[playerid]==0) { SetTimer("Three", 1000, 0); SetTimer("Two", 2000, 0); SetTimer("One", 3000, 0); SetTimer("Go", 4000, 0); blockspam[playerid]=1; SetTimer("CountdownSpam",5000,0); blockspam[playerid]=1; } else { SPD(playerid, 2, DIALOG_STYLE_MSGBOX, "{FF0000}Matt Anti Spam", "{FFFAFA}You have to wait 5 seconds till you can make another countdown", "Close", ""); } return true; } if(strcmp("/afk", cmdtext, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Сега си AFK, напиши /back за да се върнеш отново!"); TogglePlayerControllable(playerid,0); label[playerid] = Create3DTextLabel("AFK",yellow,30.0,40.0,50.0,40.0,0); Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7); new string3[70]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "%s отиде AFK!", name); SendClientMessageToAll(COLOR_YELLOW, string3); } if(strcmp("/back", cmdtext, true) == 0) { SendClientMessage(playerid, COLOR_YELLOW, "Ти се завърна!"); TogglePlayerControllable(playerid,1); new string3[70]; new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(string3, sizeof(string3), "%s се завърна!", name); SendClientMessageToAll(COLOR_YELLOW, string3); Delete3DTextLabel(Text3D:label[playerid]); return 1; } new string[256]; new tmp[256]; new playermoney; new giveplayer[MAX_PLAYER_NAME]; new giveplayerid, specplayerid, moneys; cmd = strtok(cmdtext, idx); printf("[cmd][%s]: %s",PlayerName(playerid),cmdtext);
new adtext[256];
cmd = strtok(cmdtext, idx);
if(strlen(cmd) == 1) return SendClientMessage(playerid, COLOR_WHITE, "Invalid command.");
if(strcmp("/me", cmd, true) == 0)
pawn Код:
|