[help] plz fix my errors! /arrest
#1

i made this , arrest cmd but i got errors :S
heres the code:
pawn Код:
if(strcmp("/arrest", cmdtext, true, 7) == 0)
    {
        if(gTeam[playerid] != TEAM_COP) return SendClientMessage(playerid, COLOR_RED, "You Are Not A Cop. Only Cops Can Use This Command.");
        if(strlen(cmdtext[8]) == playerid) return SendClientMessage(playerid,COLOR_RED,"You Cannot Arrest Yourself, Idoit.");

        if(strlen(cmdtext[8]) == 0){

        new closest[MAX_PLAYERS];
        new closestlvl;
        closest = GetClosestPlayer(0);
        closestlvl = GetPlayerWantedLevel(closest);
        if(closestlvl < 4)
        {


        new copname[MAX_PLAYER_NAME];
        new cmdname[MAX_PLAYER_NAME], string[128];

        GetPlayerName(playerid, copname, sizeof(cmdname));
        GetPlayerName(strval(cmdtext[8]), cmdname, sizeof(cmdname));

        format(string, sizeof(string), "%s (%d) Has Been Arested By Officer %s (%d)", cmdname,strval(cmdtext[8]),copname,playerid);
        SendClientMessageToAll(COLOR_PURPLE, string);

        new rand;
        rand = random(sizeof(AJail));
        SetPlayerInterior(strval(cmdtext[8]), 3);
        SetPlayerPos(strval(cmdtext[8]), AJail[rand][0], AJail[rand][1], AJail[rand][2]);
        gPlayerJailed[playerid] = 1;
        SetPlayerWantedLevel(strval(cmdtext[8]),0);

        return 1;
        } else return SendClientMessage(playerid,COLOR_RED,"No Wanted Players Close Enough TO Arrest.");


        return 1;
        }


        return 1;
    }
and heres the errors

Код:
C:\Users\Ethan\Desktop\SAMPSERVER\gamemodes\Untitled.pwn(1518) : error 033: array must be indexed (variable "closest")
C:\Users\Ethan\Desktop\SAMPSERVER\gamemodes\Untitled.pwn(1519) : error 035: argument type mismatch (argument 1)
C:\Users\Ethan\Desktop\SAMPSERVER\gamemodes\Untitled.pwn(1544) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply


Messages In This Thread
[help] plz fix my errors! /arrest - by StrickenKid - 25.02.2009, 00:16
Re: [help] plz fix my errors! /arrest - by Mikep - 25.02.2009, 00:25
Re: [help] plz fix my errors! /arrest - by StrickenKid - 25.02.2009, 00:32
Re: [help] plz fix my errors! /arrest - by Norn - 25.02.2009, 00:41
Re: [help] plz fix my errors! /arrest - by StrickenKid - 25.02.2009, 00:50
Re: [help] plz fix my errors! /arrest - by JaYmE - 25.02.2009, 00:52
Re: [help] plz fix my errors! /arrest - by StrickenKid - 25.02.2009, 01:03

Forum Jump:


Users browsing this thread: 1 Guest(s)