Help with a new function
#1

I'm using a 'new' function so where when someone types a CMD it sets the new function to 1. How do I define the user who is using it's playerid with this function?
Reply
#2

Could you be a bit more specific? Are you trying to change a variable when a player uses a specific command? If so, what's the name of the variable?
Reply
#3

Ok so when a person types a CMD, by default the function is set to 0. Then when he types this CMD it's set to 1. How can I define that person's playerid? I'm thinking something like

new function =1[definedid] ?

I don't like to give out a lot of my script ideas. :S
Reply
#4

At the top of your script:

pawn Код:
new functionUsage[MAX_PLAYERS];
To set the value (in the command or whatever):
pawn Код:
functionUsage[playerid] = 1;
Reply
#5

Says playerid is not defined.
Reply
#6

I narrowed it down to only one error. Here's the error lines:

Код:
new TVMan
TVMan = OnTV[playerid]; // Error line
Error:
Код:
 error 001: expected token: ";", but found "-identifier-"
Reply
#7

pawn Код:
new TVMan;
You forgot a ";"
Reply
#8

You can shorten it one line by typing it like this

pawn Код:
new TVMan = OnTV[playerid];
And it also looks cleaner
Reply
#9

aaah!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)