#1

so im not sure about my scriptscan someone tell me if it wrong lol thx >

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   
    if(strcmp ("/kick0",cmdtext, true) == 0)
    {

        Kick(playerid,0);
       return 1;
    }
return 0;
}
"so i want this cmdkick only id0"
Reply
#2

Well that's definitely not the way to go about scripting commands. Look at ANY other script to see how to do this.
Reply
#3

EDIT: It is very mature to support someone who wants to help with negative behaviours. Deleted.
Reply
#4

Not really - That CMD won't work.

Lemme explain why

- If you check at wiki the kick function.

You'll find that it is only usable like that -
PHP код:
kick(playerid); 
You can't specify a certain ID - So that won't work

Inorder to get another player ID - You'll need to use SSCANF or strtok

However - SSCANF won't work with strcmp [The command processor]

So you'll have to learn strtok inorder to make CMD's that would interact with other ID's.

Notice : "playerid" means the ID of the player that used the CMD.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)