[HELP] /editcardescription - 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: [HELP] /editcardescription (
/showthread.php?tid=110974)
[HELP] /editcardescription -
Nakash - 29.11.2009
I need help with this code,it gives me an error when i compile it.
Код:
if(strcmp(cmd, "/editcardes", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not an Admin !");
return 1;
}
if(IsAnOwnableCar(idcar))
{
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: /osay TEXT");
return 1;
}
CarInfo[idcar][cDescription] = result;
format(string, sizeof(string), "Vehicle id %s's price changed to %d",idcar,CarInfo[idcar][cValue],result);
SendClientMessage(playerid, COLOR_GRAD2, string);
OnPropUpdate();
}
}
return 1;
}
C:\Documents and Settings\аеш рчщ\щемзп дтбегд\оег згщ\Script\roleplay.pwn(21695) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
I have tried to change the result to 256,but that didn't work.
Re: [HELP] /editcardescription -
diesulke - 29.11.2009
Wich line is 21695? Can you show us the line please.
Re: [HELP] /editcardescription -
Nakash - 29.11.2009
Quote:
Originally Posted by diesulke
Wich line is 21695? Can you show us the line please.
|
[21695] CarInfo[idcar][cDescription] = result;
Re: [HELP] /editcardescription -
Nakash - 29.11.2009
Sorry for DB,meant to Edit.
I really need this guys,please ;[
Re: [HELP] /editcardescription -
Joe Staff - 29.11.2009
Use
format instead.
Use:
pawn Код:
format(CarInfo[idcar][cDescription],256,"%s",result);
Probably not the best method, but it will work.