/Jackass
#8

Quote:
Originally Posted by Kitten
Посмотреть сообщение
EDIT: Code not tested

Ok look i think this is what u mean

If u are admin (logged in as rcon )
you can do /jackass id for example /jackass 2 changes the playerid of 2 into jackass am i right so then heres the code
u need strtok i included it in the code

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new
    index,
    cmd[20];
    cmd = strtok(cmdtext, index);
    if (strcmp(cmd, "/jackass", true) == 0)
    {
        new
        tmp[20],
        id;
        tmp = strtok(cmdtext, index);
        if (strlen(tmp))
        {
            id = strval(tmp);
            if (IsPlayerConnected(id))
            if(IsPlayerAdmin(playerid))
            {
                SetPlayerSkin(playerid,252);
                new name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, sizeof(name));
                new messege[128];
                format(messege,sizeof(messege), "%s(%d) Is a Jackass!!!", name, playerid);
                SendClientMessageToAll(0xDEEE20FF,messege);
            }
            else
            {
                SendClientMessage(playerid, 0xFF0000AA, "Player not found");
            }
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/jackass <playerid>\"");
        }
        return 1;
    }
    return 0;
}

// You need strtok for this to work

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}

PLEASE REPLY IF IT WORKS
It dont work, when i /Jackass 1 it only change my skin, it dont change the skin on the player i watnt to change skin,

Sorry for bad english
Reply


Messages In This Thread
/Jackass - by Larsey123IsMe - 12.11.2010, 01:57
Re: /Jackass - by Salmon - 12.11.2010, 02:08
Re: /Jackass - by Larsey123IsMe - 12.11.2010, 02:21
Re: /Jackass - by Larsey123IsMe - 12.11.2010, 02:59
Re: /Jackass - by Kitten - 12.11.2010, 03:35
Re: /Jackass - by Larsey123IsMe - 12.11.2010, 03:42
Re: /Jackass - by Kitten - 12.11.2010, 03:49
Re: /Jackass - by Larsey123IsMe - 12.11.2010, 04:02
Re: /Jackass - by Retardedwolf - 12.11.2010, 04:03
Re: /Jackass - by Retardedwolf - 12.11.2010, 06:24

Forum Jump:


Users browsing this thread: 1 Guest(s)