A Simple Question, Its not giving the whole string
#1

pawn Code:
if(strfind(PlayerInfo[playerid][pRoleplayName], "_", true) == -1)   //Find '_' In Names
    {
        new string[256];
        format(string, sizeof(string),"[Auto Kick] %s has been kicked from the server [Reason: Invalid Roleplay Name]", GetName(playerid)); //Kick Message
        SendClientMessageToAll(COLOR_RED , string);    //Kick Message
        SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________________________________");
        SendClientMessage(playerid, COLOR_YELLOW, "You have been kicked from the server.");
        SendClientMessage(playerid, COLOR_YELLOW, "Reason: Invalid Name.");
        SendClientMessage(playerid, COLOR_YELLOW, "Your roleplay name is non-roleplay, please use Firstname_LastName format.");
        SendClientMessage(playerid, COLOR_YELLOW, "(Examples: John_Smith, James_Garcia, Vikas_Gothwal)");
        SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________________________________");
        Kick(playerid);
    }
Last 2 lines does not show why
Reply
#2

Can't see any reason why they wouldn't.

Are you sure it's the last 2 lines?

Sometimes you might not see some of the first lines show as you put out too many at once (you have to hit T key and scroll up).
Reply
#3

Yeah i am sure that Last 2lines are not showing
Reply
#4

try use a timer to kick the player... if this fix your problem your GM is really messed up...
Reply
#5

How my Gamemode is Messed up?

ANd 1 thing more that i am really bad in using Timers. If you can help me then You will get +1
Reply
#6

did you try to make a timer to kick the player??

pawn Code:
if(strfind(PlayerInfo[playerid][pRoleplayName], "_", true) == -1)   //Find '_' In Names
    {
        new string[256];
        format(string, sizeof(string),"[Auto Kick] %s has been kicked from the server [Reason: Invalid Roleplay Name]", GetName(playerid)); //Kick Message
        SendClientMessageToAll(COLOR_RED , string);    //Kick Message
        SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________________________________");
        SendClientMessage(playerid, COLOR_YELLOW, "You have been kicked from the server.");
        SendClientMessage(playerid, COLOR_YELLOW, "Reason: Invalid Name.");
        SendClientMessage(playerid, COLOR_YELLOW, "Your roleplay name is non-roleplay, please use Firstname_LastName format.");
        SendClientMessage(playerid, COLOR_YELLOW, "(Examples: John_Smith, James_Garcia, Vikas_Gothwal)");
        SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________________________________");
       SetTimerEx("Kickk", 1000, false, "i",playerid);
    }
forward Kickk(playerid);
public Kickk(playerid)
{
Kick(playerid);
return 1;
}
try this just for a check...
Reply
#7

Timers are quite easy.

If you know how to make functions, that's all you do and use as above, SetTimerEx with the function name in "" and specify the time in milliseconds, whether it should loop continiously or not etc.

But that shouldn't be the problem.

By the way, try making string[256], string[128];, pretty sure only 128 can be visible anyway, now sure if that would cause any actual problems.
Reply
#8

Quote:
Originally Posted by GrimR
View Post
Timers are quite easy.

If you know how to make functions, that's all you do and use as above, SetTimerEx with the function name in "" and specify the time in milliseconds, whether it should loop continiously or not etc.

But that shouldn't be the problem.

By the way, try making string[256], string[128];, pretty sure only 128 can be visible anyway, now sure if that would cause any actual problems.
yes, 128 cells is the samp chat box max cells but in that case string[102]; is perfectly (77 chars + 24(max_player_name) + NULL)

but 1 string 256 dont do all this problem... but a lot of 256 do...
Reply
#9

Yeah I didn't think it would, but it's probably good for em to start using 128.

Like you I can't see any problem with the code supplied, something else has to be causing the problem.
Reply
#10

Quote:
Originally Posted by Pharrel
View Post
did you try to make a timer to kick the player??

pawn Code:
if(strfind(PlayerInfo[playerid][pRoleplayName], "_", true) == -1)   //Find '_' In Names
    {
        new string[256];
        format(string, sizeof(string),"[Auto Kick] %s has been kicked from the server [Reason: Invalid Roleplay Name]", GetName(playerid)); //Kick Message
        SendClientMessageToAll(COLOR_RED , string);    //Kick Message
        SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________________________________");
        SendClientMessage(playerid, COLOR_YELLOW, "You have been kicked from the server.");
        SendClientMessage(playerid, COLOR_YELLOW, "Reason: Invalid Name.");
        SendClientMessage(playerid, COLOR_YELLOW, "Your roleplay name is non-roleplay, please use Firstname_LastName format.");
        SendClientMessage(playerid, COLOR_YELLOW, "(Examples: John_Smith, James_Garcia, Vikas_Gothwal)");
        SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________________________________");
       SetTimerEx("Kickk", 1000, false, "i",playerid);
    }
forward Kickk(playerid);
public Kickk(playerid)
{
Kick(playerid);
return 1;
}
try this just for a check...
That Worked yay
Reply
#11

Really that fixed it?

Hey try doing the kick before you spit all the messages out (without the timer), see if that makes a difference, might save needing a timer.
Reply
#12

Quote:
Originally Posted by Pharrel
View Post
try use a timer to kick the player... if this fix your problem your GM is really messed up...
like a sayd before... if his GM is doing functions disorderly a timer wont make any difference...
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)