22.02.2015, 18:47
Glad you asked. The person above your post left you over to the guess-what-you-did-wrong part.
CMD:makedonator requires two parameters. In your case: the targetid and the type of donator. You defined everything correctly till the sscanf function.
You 'told' sscanf that there is 1 parameter to look out for: targetid.
Since no 'type' parameter was defined in your sscanf function, it will ignore all the strcmp functions underneath returning 1 for the command after inserting the target's id.
We define the second parameter (the 'type' parameter) in the following code:
And we define a size to the 's' specifier since 'type' is a string.
CMD:makedonator requires two parameters. In your case: the targetid and the type of donator. You defined everything correctly till the sscanf function.
pawn Код:
(sscanf(params, "u", userid))
Since no 'type' parameter was defined in your sscanf function, it will ignore all the strcmp functions underneath returning 1 for the command after inserting the target's id.
We define the second parameter (the 'type' parameter) in the following code:
pawn Код:
(sscanf(params, "us[16]", userid, type))