[HELP] Where add else
#1

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");
    }
Reply
#2

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);
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)