Jump to content
  • 0

[GF/RP] sa vada numa cei care au radio


impulse81

Question

cum fac la comanda /news de la news reporter , sa vada ce scrie reporterii pe /news numa cei care au cumparat radio de la 24/7? Si cum fac sa cumperi radio de la 24/7 ?

aceasta este 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 == nr1 || newcar == nr2 || newcar == nr3 || newcar == nr4 || newcar == nrh)

{

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;

result[0] = toupper(result[0]);

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

    {

        new advertiser[MAX_PLAYER_NAME];

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

format(string, sizeof(string), "AdmCmd: %s was warned & kicked by Server BOT, reason: Server Advertising",advertiser);

SendClientMessageToAll(COLOR_LIGHTRED,string);

KickLog(string);

        PlayerInfo[playerid][pWarns] += 1;

        Kick(playerid);

        return 1;

    }

for(new s = 0; s < num_words; s++)

{

new pos;

while((pos = strfind(result,Swears,true)) != -1) for(new i = pos, j = pos + strlen(Swears); i < j; i++)

{

result = '*';

}

}

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;

}[/pawn]

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

cum fac la comanda /news de la news reporter , sa vada ce scrie reporterii pe /news numa cei care au cumparat radio de la 24/7? Si cum fac sa cumperi radio de la 24/7 ?

aceasta este comanda:

[pawn] if(strcmp(cmd, "/news", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

                  if(PlayerInfo[playerid][pRadio] == 0)//in loc de radio pui ce ai tu cand isi cumpara radio.

{

SendClientMessage(playerid, TEAM_CYAN_COLOR, " Nu ai cumparat radio...");

return 1;

}

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 == nr1 || newcar == nr2 || newcar == nr3 || newcar == nr4 || newcar == nrh)

{

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;

result[0] = toupper(result[0]);

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

    {

        new advertiser[MAX_PLAYER_NAME];

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

format(string, sizeof(string), "AdmCmd: %s was warned & kicked by Server BOT, reason: Server Advertising",advertiser);

SendClientMessageToAll(COLOR_LIGHTRED,string);

KickLog(string);

        PlayerInfo[playerid][pWarns] += 1;

        Kick(playerid);

        return 1;

    }

for(new s = 0; s < num_words; s++)

{

new pos;

while((pos = strfind(result,Swears,true)) != -1) for(new i = pos, j = pos + strlen(Swears); i < j; i++)

{

result = '*';

}

}

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;

}[/pawn]

gXvsYS
Link to comment
Share on other sites

cand pun cmd imi da aceste erori:

[pawn] if(newcar == nr1 || newcar == nr2 || newcar == nr3 || newcar == nr4 || newcar == nrh)

{

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

new length = strlen(cmdtext);

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

{

idx++;  //asta este linia 41113

}

new offset = idx;

new result[64];

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

{

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

idx++;

}[/pawn]

Link to comment
Share on other sites

F:\Metin12\BackUps\samp03\pawno\include\JunkBuster.inc(3238) : warning 201: redefinition of constant/macro (symbol "OnPlayerEnterRaceCheckpoint")

F:\Metin12\BackUps\samp03\gamemodes\OnSpeed.pwn(14000) : warning 216: nested comment

F:\Metin12\BackUps\samp03\gamemodes\OnSpeed.pwn(41098) : error 017: undefined symbol "pRadio"

F:\Metin12\BackUps\samp03\gamemodes\OnSpeed.pwn(41115) : error 029: invalid expression, assumed zero

F:\Metin12\BackUps\samp03\gamemodes\OnSpeed.pwn(41115) : error 001: expected token: ")", but found ";"

F:\Metin12\BackUps\samp03\gamemodes\OnSpeed.pwn(41115) : error 036: empty statement

F:\Metin12\BackUps\samp03\gamemodes\OnSpeed.pwn(41115) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

5 Errors.

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.