Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:ad( playerid, params [ ] )
- {
- new
- sendername[25],
- string[128],
- result;
- if(IsPlayerConnected(playerid))
- {
- if(P_DATA[playerid][pMuted] >= 1)
- {
- SendClientMessage(playerid, TEAM_CYAN_COLOR, "Nu poti da un /ad, ai mute!");
- return 1;
- }
- if( sscanf( params, "d", result ) )
- return SendClientMessage( playerid, -1, "{00FF00}Folosire:{FFFFFF} /ad [text]" );
- if(gPlayerLogged[playerid] == 0)
- {
- SendClientMessage(playerid, COLOR_GREY, "** Nu esti logat inca !");
- return 1;
- }
- if(P_DATA[playerid][pLevel] < 2)
- {
- SendClientMessage(playerid, COLOR_GREY, "** Iti trebuie minim level 2 !");
- return 1;
- }
- if(!PlayerToPoint(3.0, playerid, SBizzInfo[7][sbEntranceX], SBizzInfo[7][sbEntranceY], SBizzInfo[7][sbEntranceZ]) && !PlayerToPoint(3.0, playerid, SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ]))
- {
- SendClientMessage(playerid, COLOR_GREY, "** Nu esti la sediul CNN.");
- return 1;
- }
- GetPlayerName(playerid, sendername, sizeof(sendername));
- if (AdTimer[playerid] > 0)
- {
- format(string, sizeof(string), "** Asteapta %d secunde inainte de a mai plasa un anunt !", (addtimerls/1000));
- SendClientMessage(playerid, COLOR_GRAD2, string);
- return 1;
- }
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}AD: {FFFFFF}Nu poti plasa un anunt dintr-un vehicul!");
- for(new i; i < sizeof(TLD); i++)
- {
- if(strfind(result, TLD[i], true) != -1)
- {
- new reclama2[MAX_PLAYER_NAME];
- GetPlayerName(playerid, reclama2, sizeof(reclama2));
- SendClientMessage(playerid, COLOR_RED, "{0066FF}Reclama: {FFFFFF}Nu face reclama!");
- format(string, 256, "{0066FF}Warnings: {FF0000}%s {FFFFFF}a incercat sa faca reclama. {0066FF}Mesaj : {FFFFFF}%s .", reclama2, result);
- ABroadCast(COLOR_YELLOW,string,1);
- return 0;
- }
- }
- if(GoIP(result))
- {
- new reclama[MAX_PLAYER_NAME];
- GetPlayerName(playerid, reclama, sizeof(reclama));
- SendClientMessage(playerid, 0xFF0000FF, "{0066FF}Reclama: {FFFFFF}Nu face reclama!");
- format(string, 256, "{0066FF}Warnings: {FF0000}%s {FFFFFF}a incercat sa faca reclama. {0066FF}Mesaj : {FFFFFF}%s .", reclama, result);
- ABroadCast(COLOR_YELLOW,string,1);
- return 0;
- }
- if(PlayerToPoint(3.0,playerid,SBizzInfo[7][sbEntranceX], SBizzInfo[7][sbEntranceY], SBizzInfo[7][sbEntranceZ]) || PlayerToPoint(3.0,playerid,SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ]))
- {
- new payout;
- if(PlayerToPoint(3.0,playerid,SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ])) payout = idx * SBizzInfo[8][sbEntranceCost]; else payout = idx * SBizzInfo[7][sbEntranceCost];
- if(GetPlayerCash(playerid) < payout)
- {
- format(string, sizeof(string), "** Ai folosit %d caractere costand $%s, si nu detii aceasta suma.", offset, FormatNumber(payout));
- SendClientMessage(playerid, COLOR_WHITE, string);
- return 1;
- }
- GivePlayerMoneyEx(playerid, - payout);
- if(PlayerToPoint(3.0,playerid,SBizzInfo[7][sbEntranceX], SBizzInfo[7][sbEntranceY], SBizzInfo[7][sbEntranceZ]))
- {
- SBizzInfo[7][sbTill] += payout;
- ExtortionSBiz(7, payout);
- }
- if(PlayerToPoint(3.0,playerid,SBizzInfo[8][sbEntranceX], SBizzInfo[8][sbEntranceY], SBizzInfo[8][sbEntranceZ]))
- {
- SBizzInfo[8][sbTill] += payout;
- ExtortionSBiz(8, payout);
- }
- for(new x = 0; x < sizeof(AdList); x++) {
- if(!strlen(AdList[x])) {
- format(AdList[x], 200, "Advertisement placed by %s (Phone: {FFFFFF}%d{00D900}): %s", sendername, P_DATA[playerid][pPnumber], (result));
- format(string, sizeof(string), "~r~-~g~$~r~%s", FormatNumber(strlen(result)*SBizzInfo[1][sbEntranceCost]));
- GameTextForPlayer(playerid, string, 5000, 5);
- SendClientMessage(playerid,COLOR_WHITE,"{C90000}Advertisement: {FFFFFF}Your ad has been added to the list. An ad is sent every 10 seconds!");
- SBizzInfo[1][sbTill] += strlen(result)*SBizzInfo[1][sbEntranceCost];
- SBizzInfo[1][sbProducts]--;
- format(string,sizeof(string),"UPDATE sbizz SET `Till`='%d',`Products`='%d' WHERE `ID`='1'",SBizzInfo[1][sbTill],SBizzInfo[1][sbProducts]);
- mysql_query(mysql, string);
- AdTimer[playerid] = 1;
- return 1;
- }
- }
- SendClientMessage(playerid, -1, "Error: Message queue is full!");
- }
- }
- return 1;
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement