[Help] Strange Problem with Sscanf
#1

Hello, i will give you example of my problem and you try to help me

Lets said, there is 2 players InGame named SanAndreas and SanAndreasMP.

And i write "/ban SanAndreasMP Wrong Nickname" and server banned SanAndreas...

This is my sscanf code for /ban cmd

Код:
if(sscanf(params,"us[64]",targetid,reason)) return SCM(playerid, Crvena,"Use: {FFFFFF}/ban [ID/Nick] [Reason]");
Help needed

PS. Talking about freeroam/dm gamemode, so there is no Nick_Name
Reply
#2

are you update your sscanf?
Reply
#3

Код:
new targetid;
new Playername[MAX_PLAYER_NAME];
GetPlayerName(targetid, Playername, sizeof(Playername));
if(sscanf(params,"us[64]",targetid,reason)) return SCM(playerid, 0xFF0000,"Use: {FFFFFF}/ban [ID/Nick] [Reason]"
);

Maybe will this work?
Reply
#4

Quote:
Originally Posted by [TMS]Legena
Посмотреть сообщение
Код:
new targetid;
new Playername[MAX_PLAYER_NAME];
GetPlayerName(targetid, Playername, sizeof(Playername));
if(sscanf(params,"us[64]",targetid,reason)) return SCM(playerid, 0xFF0000,"Use: {FFFFFF}/ban [ID/Nick] [Reason]"
);

Maybe will this work?
No, it will not. Your code will always get the name of the player with ID 0. sscanf line is supposed to be first so the ID from the parameters can be assigned on targetid.
Reply
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
No, it will not. Your code will always get the name of the player with ID 0. sscanf line is supposed to be first so the ID from the parameters can be assigned on targetid.
There is no help for that??

Quote:
Originally Posted by Luca12
Посмотреть сообщение
are you update your sscanf?
ofcourse, im not noob
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)