Jump to content
  • 0

Problema NR!


drkinder

Question

Salut!

AM si eu o problema cu comanda /news de la news reporter cand ma urc in masina sau un heli si scriu /news imi spune ca nu sunt in van/chopper ce trebuie sa fac ca sa imi functioneze comanda?

[pawn] 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 == 140 || newcar == 141 || newcar == 142)

{

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;

}

if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pHelper] == 0)

    {

    for(new i=0; i<MAX_ENTRY; i++)

{

    if(!Swear[0]) continue;

Cenzura(result,Swear);

}

}

if(FindIP(result)) /// Anti-Reclama

  {

SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you write an IP Adrees.");

new advertiser[MAX_PLAYER_NAME];

GetPlayerName(playerid, advertiser, sizeof(advertiser));

format(string, sizeof(string), "ThegBoT: {FFFF00}%s was kicked with reason: Write an IP Adreess (Reclama)",advertiser);

SendClientMessageToAll(COLOR_RED,string);

KickLog(string);

Kick(playerid);

return 1;

}

if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)

{

            new advertiser[MAX_PLAYER_NAME];

GetPlayerName(playerid, advertiser, sizeof(advertiser));

format(string, sizeof(string), "ThegBot: {FFFF00}%s was kicked with reason: Reclama pe /news",advertiser);

SendClientMessageToAll(COLOR_RED,string);

Kick(playerid);

return 0;

}

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;

}[/pawn]

Asta e comanda pe care o am eu,astept un raspuns.

Multumesc anticipat! :))

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Lasa reply daca e bun sau nu:

[pawn]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 == 582 || newcar == 488 || newcar == 0)

{

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;

}

if(PlayerInfo[playerid][pAdmin] == 0 || PlayerInfo[playerid][pHelper] == 0)

    {

    for(new i=0; i<MAX_ENTRY; i++)

{

    if(!Swear[0]) continue;

Cenzura(result,Swear);

}

}

if(FindIP(result)) /// Anti-Reclama

  {

SendClientMessage(playerid, COLOR_RED, "You have kicked for Guardian , because you write an IP Adrees.");

new advertiser[MAX_PLAYER_NAME];

GetPlayerName(playerid, advertiser, sizeof(advertiser));

format(string, sizeof(string), "ThegBoT: {FFFF00}%s was kicked with reason: Write an IP Adreess (Reclama)",advertiser);

SendClientMessageToAll(COLOR_RED,string);

KickLog(string);

Kick(playerid);

return 1;

}

if(anty(result) && PlayerInfo[playerid][pAdmin] == 0 && PlayerInfo[playerid][pHelper] == 0)

{

            new advertiser[MAX_PLAYER_NAME];

GetPlayerName(playerid, advertiser, sizeof(advertiser));

format(string, sizeof(string), "ThegBot: {FFFF00}%s was kicked with reason: Reclama pe /news",advertiser);

SendClientMessageToAll(COLOR_RED,string);

Kick(playerid);

return 0;

}

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;

}[/pawn]

Link to comment
Share on other sites

Variabilele au calitatea de a stoca anumite informatii in memorie, iar cand creezi o masina cu o functie, functia are calitatea sa returneze cu ID-ul masinii.

Idea e sa folosesti variabila = CreateVehicle ( plm.. ); iar dupa sa verifici variabila..

Nu prea ajut la categoria RP/GF.

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.