Server's gonna to be dead - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Server's gonna to be dead (
/showthread.php?tid=68772)
Server's gonna to be dead -
Danut - 13.03.2009
I've got a problem ... First , lemme show you the cmd
pawn Код:
if(strcmp(cmd,"/writenote",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "You aren't logged in.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE,"USAGE: /writenote (1 - 5) [text]");
return 1;
}
else if (strcmp("1", tmp, true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /writenote (1 - 5) [TEXT]");
return 1;
}
if(PlayerInfo[playerid][N1slot] == 0)
{
strmid(PlayerInfo[playerid][N1], result, 0, strlen(result), 256);
PlayerInfo[playerid][N1slot] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Note 1 created successfuly.");
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your Note 1 it's aleardy written.");
return 1;
}
}
If i type a text between 0 and above 25 , it works & saved perfectly. But , if i type a text with 26 letters , BAM , server recive that Error "
Don't Send ... "
[Pastebin]
Re: Server's gonna to be dead -
Danut - 13.03.2009
i don't want to MAKE SPAM , but , could somebady help me ?
Re: Server's gonna to be dead -
MenaceX^ - 13.03.2009
Let's start from trying to fix the identitation
Re: Server's gonna to be dead -
Danut - 13.03.2009
If i type /writenote 1 <
24Characters> it works , but if i type /writenote 1 <
25+ Characters> it don't works
I've tryed to change the new result[64] into [128] or [256] , but same problem
Re: Server's gonna to be dead -
Dujma - 13.03.2009
You have defined that the max size of the result is 64 and on strmid function the max size is 256. Maybe that is the problem?
Re: Server's gonna to be dead -
Danut - 13.03.2009
Oh, finnaly i've made it . Topic Closed.
Re: Server's gonna to be dead -
Norn - 13.03.2009
Quote:
Originally Posted by Danut
Oh, finnaly i've made it . Topic Closed.
|
Your not even gonna thank Dujma? Nice.