Force to Class Selection
#1

pawn Код:
if(!IsPlayerAdmin(playerid))return 0;
    new tmp[64],id;
    tmp=strtok(cmdtext,idx);
    if(!strlen(tmp)) return 0;
    id=strval(tmp);
    SetPlayerHealth(id,0);
    ForceClassSelection(id);
    return 1;
This is my code.. its in On Player Command Text i have all the neccessary variables for the command.. but it doesnt seem to work
Reply
#2

What doesn't seem to be working? Make sure that tmp has a value and make sure the player is logged into the rcon console.
Reply
#3

this is the script to force some player to class selcetion
Reply
#4

use sscanf

if(!IsPlayerAdmin(playerid))return 0;
new id;
if(ssccanf(params,"uz",id)) return 0;
ForceClassSelection(id);
return 1;
Reply
#5

i have dcmd code in my script.. will sscanf be compatible with it ??
Reply
#6

hmm idk me i got zcmd so maybe dcmd will be compatible with it
Reply
#7

coast nothing to try ^^
Reply
#8

sscanf is compatible with dcmd.

When you have called

pawn Код:
ForceClassSelection(id);
You need to kill the player to send them to the class selection screen.

pawn Код:
//So
ForceClassSelection(id);
SetPlayerHealth(id, 0.0);
In your code, you kill them before using ForceClassSelection, thus the command will not work. (It will, but not for the intended result)
Reply
#9

ho ye forget set player heatlh ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)