A Simple Question, Its not giving the whole string -
$India$ - 02.10.2011
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
Re: A Simple Question, Its not giving the whole string -
GrimR - 02.10.2011
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).
Re: A Simple Question, Its not giving the whole string -
$India$ - 02.10.2011
Yeah i am sure that Last 2lines are not showing
Re: A Simple Question, Its not giving the whole string -
Pharrel - 02.10.2011
try use a timer to kick the player... if this fix your problem your GM is really messed up...
Re: A Simple Question, Its not giving the whole string -
$India$ - 02.10.2011
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
Re: A Simple Question, Its not giving the whole string -
Pharrel - 02.10.2011
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...
Re: A Simple Question, Its not giving the whole string -
GrimR - 02.10.2011
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.
Re: A Simple Question, Its not giving the whole string -
Pharrel - 02.10.2011
Quote:
Originally Posted by GrimR
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...
Re: A Simple Question, Its not giving the whole string -
GrimR - 02.10.2011
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.
Re: A Simple Question, Its not giving the whole string -
$India$ - 02.10.2011
Quote:
Originally Posted by Pharrel
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
Re: A Simple Question, Its not giving the whole string -
GrimR - 02.10.2011
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.
Re: A Simple Question, Its not giving the whole string -
Pharrel - 02.10.2011
Quote:
Originally Posted by Pharrel
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...