Adminscript
#7

Quote:
Originally Posted by icorne
Quote:
Originally Posted by wafffllesss
Quote:
Originally Posted by icorne
Anyone else?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new idx;
  new cmd[256];
  cmd = strtok(cmdtext, idx);
  if(!strcmp("/makepilot", cmd, true))
  {
    if(IsPlayerAdmin(playerid))
        {
        new tmp[128];
        tmp = strtok(cmdtext,idx);
        if(!strlen(tmp)){
                SendClientMessage(playerid,0xFF6600AA,"USAGE: /makepilot [playerid]");
                return true;
            }

        new pid = strval(tmp);
        if(!IsPlayerConnected(pid)){
          SendClientMessage(playerid,0xFF6600AA,"Player is offline");
                return true;
        }
        SendClientMessage(playerid, 0xFF6600AA, "That player is now pilot!");
        SendClientMessage(pid, 0xFF6600AA, "You're now a pilot!");
        SetPlayerSkin(pid, 61);
        return 1;
        }
    }
    return 1;
}
In case you need:

pawn Код:
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;
}
Good but 1 error: C:\Documents and Settings\Administrator\Bureaublad\Warserver\filter scripts\admscript.pwn(42) : error 030: compound statement not closed at the end of file (started at line 15)
This mean you forget to close "}" something.. cuz the script i set you is working. at least for me. check your script.
Reply


Messages In This Thread
Adminscript - by icorne - 14.01.2010, 09:58
Re: Adminscript - by wiilweer - 14.01.2010, 10:05
Re: Adminscript - by icorne - 14.01.2010, 10:19
Re: Adminscript - by icorne - 14.01.2010, 10:51
Re: Adminscript - by wafffllesss - 14.01.2010, 11:22
Re: Adminscript - by icorne - 14.01.2010, 11:30
Re: Adminscript - by wafffllesss - 14.01.2010, 11:44

Forum Jump:


Users browsing this thread: 1 Guest(s)