/setvpresident /setpresident & /setmark
#1

/setvpresident & /setpresident both of these commands just set who ever used the command not the other people.
/setmark just sets what ever id you are as the mark.

pawn Код:
else if (streq(cmd,"/setpresident"))
{
    if(!strlen(cmdtext[12]))
    {
        SendClientMessage(playerid, red, "Usage: /setpresident [playerid]");
        return 1;
    }
    new ID = strval(cmdtext[12]);
    new pName[24], str[64];
    new oname[24];
    GetPlayerName(playerid,oname,24);
    if(IsPlayerConnected(ID))
    {
        GetPlayerName(playerid, pName, 24);
        format(str, 123, "* %s is the new president of San Andreas!", oname);
        SendClientMessageToAll(COLOR_LIGHTBLUE, str);
        president[playerid] = 1;
        format(str, 123, "Sucessfully Set!");
        SendClientMessage(playerid,red, str);
    }
    return 1;

}
else if (streq(cmd,"/setvpresident"))
{
    if(!strlen(cmdtext[13]))
    {
        SendClientMessage(playerid, red, "Usage: /setpresident [playerid]");
        return 1;
    }
    new ID = strval(cmdtext[13]);
    new pName[24], str[64];
    new oname[24];
    GetPlayerName(playerid,oname,24);
    if(IsPlayerConnected(ID))
    {
        GetPlayerName(playerid, pName, 24);
        format(str, 123, "* %s is the new vice president of San Andreas!", oname);
        SendClientMessageToAll(COLOR_LIGHTBLUE, str);
        vpresident[playerid] = 1;
        format(str, 123, "Sucessfully Set!");
        SendClientMessage(playerid,red, str);
    }
    return 1;

}
pawn Код:
if(strcmp(cmd, "/setmark", true) == 0)
{
    new string[128];
    new tmp[256];
    new player[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME];
    new playerid;
    new giveplayerid;
    if (rpteacher[playerid] == 1)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, COLOR_RED, "USAGE: /setmark [playerid] [1-10]");
            return 1;
        }
                new level =  strval(tmp);
        giveplayerid = ReturnUser(tmp);
        if(rpmark[giveplayerid] > 1) return SendClientMessage(playerid,COLOR_RED,"This user already has a mark!");
        tmp = strtok(cmdtext, idx);
        if(giveplayerid != INVALID_PLAYER_ID)
        {
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, player, sizeof(player));
            rpmark[giveplayerid] = level;
            format(string, sizeof(string), "Teacher %s has set your roleplay score to %d.", player,level);
            SendClientMessage(giveplayerid, 0x00C2ECFF, string);
            format(string, sizeof(string), "You have set %s 's Roleplay Score to %d.", giveplayer,level);
                SendClientMessage(playerid, 0x00C2ECFF, string);
        }
        else if(giveplayerid == INVALID_PLAYER_ID)
        {
            format(string, sizeof(string), "%i is not an active player.", giveplayerid);
            SendClientMessage(playerid, 0xE60000FF, string);
        }
    }
    else
    {
      return 1;
    }
    return 1;
}
Reply
#2

*Bump!*
Reply
#3

I suggest using ocmd or dcmd
What you did there can't work in my eyes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)