SA-MP Forums Archive
[HELP] Where add else - 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] Where add else (/showthread.php?tid=354041)



[HELP] Where add else - V4at - 25.06.2012

pawn Код:
stock SendPRTransmission(color, msg[], team)
{
    for(new i; i < MAX_PLAYERS; 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(sscanf(params,"s",text)) return SendClientMessage(playerid,raudona,"{FBDF89}USAGE: /rg [text]");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof(string),"[PR]: %s: %s", name, text);
        if(GetPlayerSkin(playerid) == 106) return SendPRTransmission(raudona, string, 106);
        if(GetPlayerSkin(playerid) == 105) return SendPRTransmission(raudona, string, 105);
        if(GetPlayerSkin(playerid) == 107) return SendPRTransmission(raudona, string, 107);
    return 1;
}
Where i can add:

pawn Код:
else
    {
        SendClientMessage(playerid,raudona,"You need to be administrator to use this command");
    }



Re: [HELP] Where add else - [MM]RoXoR[FS] - 25.06.2012

pawn Код:
new string[256], name[MAX_PLAYER_NAME], text[150];
        if(sscanf(params,"s",text)) return SendClientMessage(playerid,raudona,"{FBDF89}USAGE: /rg [text]");
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(string, sizeof(string),"[PR]: %s: %s", name, text);
        if(PlayerInfo[playerid][pAdmin]<1) return SendClientMessage(playerid,raudona,"You need to be administrator to use this command");
        if(GetPlayerSkin(playerid) == 106) return SendPRTransmission(raudona, string, 106);
        if(GetPlayerSkin(playerid) == 105) return SendPRTransmission(raudona, string, 105);
        if(GetPlayerSkin(playerid) == 107) return SendPRTransmission(raudona, string, 107);



Re: [HELP] Where add else - iggy1 - 25.06.2012

https://sampwiki.blast.hk/wiki/Control_Structures