27.01.2011, 12:52
how can the Anti-ip command / ad
anti-IP
Command
anti-IP
Код:
new is1=0; new r=0; while(strlen(text[is1])) { if('0'<=text[is1]<='9') { new is2=is1+1; new p=0; while(p==0) { if('0'<=text[is2]<='9'&&strlen(text[is2])) is2++; else { strmid(String2[r],text,is1,is2,255); if(strval(String2[r])<255) r++; is1=is2; p=1; } } } is1++; } if(r>=4) { new String[255]; new Anti_Name[255]; GetPlayerName(playerid,Anti_Name,255); format(String, sizeof(String), "Anti-advertisment %s(%d): %s",Anti_Name,playerid,text); for(new j1=0; j1 < MAX_PLAYERS;j1++) if(IsPlayerAdmin(j1)) SendClientMessage(j1, 0xFF0000FF, String); for(new z=0;z<r;z++) { new pr2; while((pr2=strfind(text,String2[z],true))!=-1) for(new i=pr2,j=pr2+strlen(String2[z]);i<j;i++) text[i]='*'; } }
Command
Код:
if(strcmp(cmd, "/ad", true) == 0) { new message[256]; new playername[MAX_PLAYER_NAME]; strmid(message, cmdtext, 3, strlen(cmdtext)); GetPlayerName(playerid, playername, sizeof(playername)); if(!strlen(message)) { SendClientMessage(playerid, 0xFF0606FF, "Type /ad [text]"); } else { format(string, sizeof(string), "{FFFFFF}[Radio]{FF0000}%s {00FF00}|Messaje by {6633FF}%s {FF0000}(playerid:%d)!",message, playername, playerid); printf(string); SendClientMessageToAll(0xADFF2FAA, string); GivePlayerMoney(playerid,-2000); } return 1; }