Author Topic: Get player's name color from %obj?  (Read 1153 times)

How can i grab the player's name color from an %obj?

I have set name color %obj.getShapeNameColor

Give more information. What type of object is %obj?
A player? %obj.client.getPlayerName()
A brick? %obj.getGroup().client.getPlayerName()
A vehicle that the player is riding? No idea.

Give more information. What type of object is %obj?
A player? %obj.client.getPlayerName()
A brick? %obj.getGroup().client.getPlayerName()
A vehicle that the player is riding? No idea.
I believe a vehicle is %obj.getMountedObject() or something.

Give more information. What type of object is %obj?
A player? %obj.client.getPlayerName()
A brick? %obj.getGroup().client.getPlayerName()
A vehicle that the player is riding? No idea.
Do mind that he wants the color off the name, not only the name.

I need a way of showing if a player has a red name (criminal) then output.

Do mind that he wants the color off the name, not only the name.
Oh, right

I need a way of showing if a player has a red name (criminal) then output.
That's a bad way of doing it. Check %client.isCriminal or %client.jobType or whatever variable it uses
« Last Edit: July 19, 2011, 03:49:38 PM by Headcrab Zombie »

Oh, right
That's a bad way of doing it. Check %client.isCriminal or %client.jobType or whatever variable it uses

This will work for Iban's City RP?

Tried and didn't give any result \/
Code: [Select]
registerOutputEvent(Player,ifWanted,"");

function Player::ifWanted(%client) {
if(%client.isCriminal) {
messageClient(%client,'',"Yes");
} else {
messageClient(%client,'',"No");
}
}

I also looked through his scripts and found he uses %client.getWantedLevel() so instead i tried earlier and no result.

Code: [Select]
registerOutputEvent(Player,ifWanted,"");

function Player::ifWanted(%client) {
if(%client.getWantedLevel()) {
messageClient(%client,'',"Yes");
} else {
messageClient(%client,'',"No");
}
}

For the code above it's result is unknown "getWantedLevel" so... thats not going to work.
« Last Edit: July 19, 2011, 05:43:09 PM by tyler0 »

The variable names I gave you were just to tell you what you should try to do. You need to look up the actual name yourself.
Use %client.dump() and look for something relating to job type or criminal status.

Also, in a player method, the first argument is player. So, your code should look something like this:

Code: [Select]
function Player::ifWanted(%player) {
if(%player.client.isCriminal) {
messageClient(%client,'',"Yes");
} else {
messageClient(%client,'',"No");
}
}

Or, what would make even more sense, would be to just make it a client event, not a player event.