19.03.2012, 06:26
Quote:
This doesn't do much of anything in game. But I compiled it without errors. It's supposed to let the player put in /rcon onduty <the player's ID> What could keep this from working in game?
Код:
public OnRconCommand(cmd[]) { new acmd[280], idx; acmd = strtok(cmd, idx); if(!strcmp(acmd,"/onduty",true)) { new Text3D:label = Create3DTextLabel("Admin On Duty", 0x990000FF, 30.0, 40.0, 50.0, 40.0, 0); Attach3DTextLabelToPlayer(label, idx, 0.0, 0.0, 0.6); } return 1; } |
it should be:
pawn Код:
public OnRconCommand(cmd[])
{
new acmd[256], idx;
acmd = strtok(cmd, idx);
if(!strcmp(acmd,"onduty",true))
{
new tmp[256];
tmp = strtok(acmd,idx);
if(!strlen(tmp))
print("Usage: /RCON onduty <playerid>");
return 1;
}
else if(!IsPlayerConnected(strval(tmp)))
print("Error: player not found!");
return 1;
}
new Text3D:label = Create3DTextLabel("Admin On Duty", 0x990000FF, 0.0, 0.0, 0.0, 0.0, 0);
Attach3DTextLabelToPlayer(label, strval(tmp), 0.0, 0.0, 0.6);
// your codes here
return 1;
}
return 0;
}