SA-MP Forums Archive
[HELP] Does not show text - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Does not show text (/showthread.php?tid=354111)



[HELP] Does not show text - V4at - 25.06.2012

Does not show text for players that have skins: 106, 105, 107

pawn Код:
stock SendPRTransmission(color, msg[], team)
{
    for(new i; i < MAX_PLAYERS; i++) // foreach(Player, i)
    {
         if(GetPlayerSkin(i) == team)
         {
             SendClientMessage(i, color, msg);
         }
    }
    return 1;
}

dcmd_rg(playerid, params[])
{
   new string[256], name[MAX_PLAYER_NAME], text[150];
   if(GetPlayerSkin(playerid) == 105 || GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 107)
        {
        if(sscanf(params,"s",text)) return SendClientMessage(playerid,raudona,"USAGE: /rg [text]");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof(string),"{DB881A}[PR] {E3B924}%s: %s", name, text);
        printf("RP %s: %s",name, text);
        if(GetPlayerSkin(playerid) == 106) return SendPRTransmission(raudona, string, 106); // So on.
        if(GetPlayerSkin(playerid) == 105) return SendPRTransmission(raudona, string, 105); // So on.
        if(GetPlayerSkin(playerid) == 107) return SendPRTransmission(raudona, string, 107); // So on.
        } else SendClientMessage(playerid,raudona,"You are not this gang member!");
    return 1;
}
Where's problem?


Re: [HELP] Does not show text - Grand_Micha - 25.06.2012

1. What the heck is "raudona?"
2. Please describe what exactly you want to do.


Re: [HELP] Does not show text - kbalor - 25.06.2012

Quote:
Originally Posted by Grand_Micha
Посмотреть сообщение
1. What the heck is "raudona?"
2. Please describe what exactly you want to do.
i think its a color, just guessing. he define raudona as a color


Re : [HELP] Does not show text - V4at - 25.06.2012

1. Red
2. Here is a portable radio, which needs to display text for players that have skins 106, 105, 107.


Re: [HELP] Does not show text - Grand_Micha - 25.06.2012

pawn Код:
dcmd_rg(playerid, params[])
{
   new string[256], name[MAX_PLAYER_NAME], text[150];
   if(GetPlayerSkin(playerid) == 105 || GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 107)
        {
        if(sscanf(params,"s",text)) return SendClientMessage(playerid,raudona,"USAGE: /rg [text]");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof(string),"{DB881A}[PR] {E3B924}%s: %s", name, text);
        printf("RP %s: %s",name, text);
        if(GetPlayerSkin(playerid) == 106) for(new i; i < MAX_PLAYERS; i++) if(GetPlayerSkin(i) == 106) SendClientMessage(i, color, msg);
        else if(GetPlayerSkin(playerid) == 105) for(new i; i < MAX_PLAYERS; i++) if(GetPlayerSkin(i) == 105) SendClientMessage(i, color, msg);
        else if(GetPlayerSkin(playerid) == 107) for(new i; i < MAX_PLAYERS; i++) if(GetPlayerSkin(i) == 107) SendClientMessage(i, color, msg);
        }
        else return SendClientMessage(playerid,raudona,"You are not this gang member!");
    return 1;
}
Was too lazy this time.


Re : [HELP] Does not show text - V4at - 25.06.2012

Код:
: error 017: undefined symbol "color"
: warning 219: local variable "i" shadows a variable at a preceding level
: error 017: undefined symbol "color"
: warning 219: local variable "i" shadows a variable at a preceding level
: error 017: undefined symbol "color"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
:/


Re: [HELP] Does not show text - Grand_Micha - 25.06.2012

pawn Код:
dcmd_rg(playerid, params[])
{
   new string[256], name[MAX_PLAYER_NAME], text[150];
   if(GetPlayerSkin(playerid) == 105 || GetPlayerSkin(playerid) == 106 || GetPlayerSkin(playerid) == 107)
        {
        if(sscanf(params,"s",text)) return SendClientMessage(playerid,raudona,"USAGE: /rg [text]");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof(string),"{DB881A}[PR] {E3B924}%s: %s", name, text);
        printf("RP %s: %s",name, text);
        if(GetPlayerSkin(playerid) == 106) for(new i; i < MAX_PLAYERS; i++) if(GetPlayerSkin(i) == 106) SendClientMessage(i, raudona, msg);
        else if(GetPlayerSkin(playerid) == 105) for(new c; i < MAX_PLAYERS; c++) if(GetPlayerSkin(c) == 105) SendClientMessage(c, raudona, msg);
        else if(GetPlayerSkin(playerid) == 107) for(new q; q < MAX_PLAYERS; i++) if(GetPlayerSkin(q)== 107) SendClientMessage(q, raudona, msg);
        }
        else return SendClientMessage(playerid,raudona,"You are not this gang member!");
    return 1;
}
Do you want me to do everything or what?