Jump to content
  • 0

/news BUG


Emy

Question

11 answers to this question

Recommended Posts

Am gasit comanda if(strcmp(cmd, "/news", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)

{

    new newcar = GetPlayerVehicleID(playerid);

        if(PlayerInfo[playerid][pMuted] == 1)

{

SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");

return 1;

}

if(newcar == 99 || newcar == 97 || newcar == 98)

{

GetPlayerName(playerid, sendername, sizeof(sendername));

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[64];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

if(!strlen(result))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /news [newstext]");

return 1;

}

format(string, sizeof(string), "NR %s: %s", sendername, result);

OOCNews(COLOR_NEWS,string);

PlayerInfo[playerid][pNewsSkill] ++;

if(PlayerInfo[playerid][pNewsSkill] == 50)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 2, soon you are able to Fly the News Chopper and talk Live."); }

else if(PlayerInfo[playerid][pNewsSkill] == 100)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 3, soon you are able to Fly the News Chopper and talk Live."); }

else if(PlayerInfo[playerid][pNewsSkill] == 200)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 4, you can fly the News Chopper now."); }

else if(PlayerInfo[playerid][pNewsSkill] == 400)

{ SendClientMessage(playerid, COLOR_YELLOW, "* Your News Reporter Skill is now Level 5, you can now talk Live with any person you want."); }

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  You are not in the News Van or Chopper !");

    return 1;

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  You are not a News Reporter !");

}

}//not connected

return 1;

}

if(strcmp(cmd, "/live", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

if(PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pLeader] == 9)

{

    if(TalkingLive[playerid] != 255)

    {

        SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Live Conversation ended.");

        SendClientMessage(TalkingLive[playerid], COLOR_LIGHTBLUE, "* Live Conversation ended.");

        TogglePlayerControllable(playerid, 1);

        TogglePlayerControllable(TalkingLive[playerid], 1);

            TalkingLive[TalkingLive[playerid]] = 255;

        TalkingLive[playerid] = 255;

        return 1;

    }

    if(PlayerInfo[playerid][pNewsSkill] < 400)

{

    SendClientMessage(playerid, COLOR_GREY, "  Your News Reporter Skill is to low to talk Live with people !");

    return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /live [playerid/PartOfName]");

return 1;

}

//giveplayerid = strval(tmp);

        giveplayerid = ReturnUser(tmp);

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

if (ProxDetectorS(5.0, playerid, giveplayerid))

{

    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Talk Live with yourself!"); return 1; }

    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "* You offered %s to have a Live Conversation.", giveplayer);

SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "* %s offered you to have a Live Conversation, type (/accept live) to accept.", sendername);

SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);

LiveOffer[giveplayerid] = playerid;

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  You are to far away from that player !");

    return 1;

}

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  Invalid ID/Name !");

    return 1;

}

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "  You are not a News Reporter !");

}

}//not connected

return 1;

}

------------------------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

Sunt generos azi uite un exemplu poti schimba cum vrei :wink:

if (strcmp(cmdtext, "/news", true)==0)
	{
    new dstrg[1024];
	strcat(dstrg," {007FFF}Majestic {F3FF02}Stunt {F81414}Romania {FCD9AC}New Version!\n");
	strcat(dstrg," {C3C3C3}• Adaugat un nou system de{FFAF00}Case\n");
	strcat(dstrg," {C3C3C3}• Adaugat mape nou la {FFAF00}/Chillaid /LSA /LVA /AA /SFA /PISCINA\n");
	strcat(dstrg," {C3C3C3}• Adaugat un aspect la {FFAF00}/teles\n");
	strcat(dstrg," {C3C3C3}• Adaugat un aspect la {FFAF00}/stats\n");
	strcat(dstrg," {C3C3C3}• Adaugat GangZone la {FFAF00}/grov\n");
	strcat(dstrg," {C3C3C3}• Adaugat un nou aspect la {FFAF00}/cmds\n");
	strcat(dstrg," {C3C3C3}• S-a scos {FFAF00}Coinsi(Monedele)\n");
	strcat(dstrg," {C3C3C3}• Un aspect mai frumos la {FFAF00}/vcmds {C3C3C3}si {FFAF00}/vips \n");
	strcat(dstrg," {C3C3C3}• S-a adaugat comanda {FFAF00}/astats \n");
	strcat(dstrg," {C3C3C3}• Este obligatoriu sa te Inregistrezi sau sa te Logiezi!\n");
	ShowPlayerDialog(playerid, 040, DIALOG_STYLE_MSGBOX, "Updates:", dstrg, "OK", "");
	return 1;
    }

Link to comment
Share on other sites

Sunt generos azi uite un exemplu poti schimba cum vrei :wink:

if (strcmp(cmdtext, "/news", true)==0)
	{
    new dstrg[1024];
	strcat(dstrg," {007FFF}Majestic {F3FF02}Stunt {F81414}Romania {FCD9AC}New Version!\n");
	strcat(dstrg," {C3C3C3}• Adaugat un nou system de{FFAF00}Case\n");
	strcat(dstrg," {C3C3C3}• Adaugat mape nou la {FFAF00}/Chillaid /LSA /LVA /AA /SFA /PISCINA\n");
	strcat(dstrg," {C3C3C3}• Adaugat un aspect la {FFAF00}/teles\n");
	strcat(dstrg," {C3C3C3}• Adaugat un aspect la {FFAF00}/stats\n");
	strcat(dstrg," {C3C3C3}• Adaugat GangZone la {FFAF00}/grov\n");
	strcat(dstrg," {C3C3C3}• Adaugat un nou aspect la {FFAF00}/cmds\n");
	strcat(dstrg," {C3C3C3}• S-a scos {FFAF00}Coinsi(Monedele)\n");
	strcat(dstrg," {C3C3C3}• Un aspect mai frumos la {FFAF00}/vcmds {C3C3C3}si {FFAF00}/vips \n");
	strcat(dstrg," {C3C3C3}• S-a adaugat comanda {FFAF00}/astats \n");
	strcat(dstrg," {C3C3C3}• Este obligatoriu sa te Inregistrezi sau sa te Logiezi!\n");
	ShowPlayerDialog(playerid, 040, DIALOG_STYLE_MSGBOX, "Updates:", dstrg, "OK", "");
	return 1;
    }
Asta ii metoda de cand Hahaha :] Uite una mai eficienta :
CMD:news(playerid,params[]) return ShowPlayerDialog(playerid, 001 , DIALOG_STYLE_MSGBOX, "News", News( ) , "Ok" , "Exit" );

News()
{
          new News[1900];
          News[0]='\0';
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          strcat(News , "Text" , 1900 );
          return News;
}

idiots.png
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.