Help.....
#1

I need someone who can create me an /ar id system for TEAM_LSPD ,TEAM_ARMY, TEAM_FBI ..

please someone
i will give a reputation



Thanks for reading
Reply
#2

What is /ar man?
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
 
    if(strcmp(cmd, "/ar", true) == 0)
    {
        new tmp[128];
        tmp = strtok(cmdtext, idx);
 
        if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /ar [playerid]");
     
        if(gTeam[playerid] == TEAM_OTHER){SendClientMessage(playerid,COLOR_RED,"Only cops can use this..");
                else
                {
                           SetPlayerInterior(idx,JailInt);/////////Here you can use your jail interior
                           SetPlayerPos(idx,JailX,jailY,jailZ);////Here you can use you jail pos
                             //and also you can add your features in jailing like timer ex to release
                            // and cops bonus by give cash to playerid and so on..
                 }
        return 1;
    }
    return 0;
}
Reply
#4

/ar is arrest
thanks harrish, but if the player isnt near to cop and if the player isnt suspect?
Reply
#5

I have the following problems:


C:\Users\Дзмзфсзт\Desktop\jimis\gamemodes\newtest. pwn(2243) : error 017: undefined symbol "strtok"
C:\Users\Дзмзфсзт\Desktop\jimis\gamemodes\newtest. pwn(2243) : error 033: array must be indexed (variable "cmd")
C:\Users\Дзмзфсзт\Desktop\jimis\gamemodes\newtest. pwn(224 : error 017: undefined symbol "strtok"
C:\Users\Дзмзфсзт\Desktop\jimis\gamemodes\newtest. pwn(224 : error 033: array must be indexed (variable "tmp")
C:\Users\Дзмзфсзт\Desktop\jimis\gamemodes\newtest. pwn(2253) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#6

add this to -> bottom of script

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;
}
Ur the fifth person this week that i had to send this function to.. lol
Reply
#7

ok thanks,but what that do?
Reply
#8

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
 
    if(strcmp(cmd, "/ar", true) == 0)
    {
        new tmp[128];
        tmp = strtok(cmdtext, idx);
 
        if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /ar [playerid]");
     
        if(gTeam[playerid] == TEAM_OTHER){SendClientMessage(playerid,COLOR_RED,"Only cops can use this..");
                else
                {
                          new Float:coppos[3];
                           GetPlayerPos(playerid,coppos[0],coppos[1],coppos[2]);
                           if(IsPlayerInRangeOfPoint(idx,10.0,coppos[0],coppos[1],coppos[2]))///This will check the suspect is near or not//
                           {
                                   new WantedLevel = GetplayerWantedLevel(idx);
                                   if(WantedLevel !=0)///this will check the wanted level of the player and allow him to arrest when he have been suspected
                                   {
                                              SetPlayerInterior(idx,JailInt);/////////Here you can use your jail interior
                                              SetPlayerPos(idx,JailX,jailY,jailZ);////Here you can use you jail pos
                                              //and also you can add your features in jailing like timer ex to release
                                             // and cops bonus by give cash to playerid and so on..
                                    }
                                    else{SendClientMessage(playerid,0XFFFFFF,"Suspect was an innocent");}
                          }
                          else{SendClientMessage(playerid,0xFFFFFF,"Arresting Player was not in Range");}
                 }
        return 1;
    }
    return 0;
}
and strtok will get the text after space in command
Reply
#9

hi.. check your PM i had cleared all the errors and send it to your PM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)