Npc kick
#1

Hi all, How to kick npc bot when Recording End?
Reply
#2

Help :/
Reply
#3

Don't double post.
https://sampwiki.blast.hk/wiki/NPC:OnRecordingPlaybackEnd
Add: Kick();

Something like this: (Not tested)
pawn Код:
public OnRecordingPlaybackEnd()
{
for(new i; i = 0; i++)
{
    new name; //maybe    new name[MAX_PLAYER_NAME];
    GetPlayerName(i, name, MAX_PLAYER_NAME);
    If(name == "Your Npc Name")
    {
        Kick(i);
    }
}
}
Edit: Forum messed identitation up
Reply
#4

( 8 ) warning 211: possibly unintended assignment
( 11 ) error 035: argument type mismatch (argument 2)
( 12 ) error 033: array must be indexed (variable "-unknown-")
( 14 ) error 017: undefined symbol "Kick"

Код:
public OnRecordingPlaybackEnd()
{
(8) for(new i; i = 0; i++)
{
    new name; //maybe    new name[MAX_PLAYER_NAME];
(11) GetPlayerName(i, name, MAX_PLAYER_NAME);
(12) if(name == "Your Npc Name")
    {
(14)  Kick(i);
    }
}
}
Reply
#5

Quote:
Originally Posted by Jantjuh
Посмотреть сообщение
Don't double post.
https://sampwiki.blast.hk/wiki/NPC:OnRecordingPlaybackEnd
Add: Kick();

Something like this: (Not tested)
pawn Код:
public OnRecordingPlaybackEnd()
{
for(new i; i = 0; i++)
{
    new name; //maybe    new name[MAX_PLAYER_NAME];
    GetPlayerName(i, name, MAX_PLAYER_NAME);
    If(name == "Your Npc Name")
    {
        Kick(i);
    }
}
}
Edit: Forum messed identitation up
go learn pawn

pawn Код:
public OnRecordingPlaybackEnd()
{
    foreach (new i : Player)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(i, name, MAX_PLAYER_NAME);
        if(!strcmp(name, "Your npc name", true))
        {
            Kick(i);
        }
    }
}
Reply
#6

Quote:
Originally Posted by fordawinzz
Посмотреть сообщение
go learn pawn

pawn Код:
public OnRecordingPlaybackEnd()
{
    foreach (new i : Player)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(i, name, MAX_PLAYER_NAME);
        if(!strcmp(name, "Your npc name", true))
        {
            Kick(i);
        }
    }
}
Dont flame everyone has to start somewhere its like me saying

Go learn english (In our lanuage(Go and Learn English))
Reply
#7

error 017: undefined symbol "foreach"
error 029: invalid expression, assumed zero
error 017: undefined symbol "i"
fatal error 107: too many error messages on one line

Код:
foreach (new i : Player)
This line
Reply
#8

You don't have foreach, just replace that line with a for statement -
pawn Код:
for ( new i = 0; i != MAX_PLAYERS; ++i )
tho I suggest you download foreach.
Reply
#9

Thanks, but 1 error :/

error 017: undefined symbol "Kick"

Код:
Kick(i);
This line.
Reply
#10

pawn Код:
#include <a_samp>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)