[HELP] /editcardescription
#1

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.
Reply
#2

Wich line is 21695? Can you show us the line please.
Reply
#3

Quote:
Originally Posted by diesulke
Wich line is 21695? Can you show us the line please.
[21695] CarInfo[idcar][cDescription] = result;


Reply
#4

Sorry for DB,meant to Edit.
I really need this guys,please ;[
Reply
#5

Use format instead.

Use:
pawn Код:
format(CarInfo[idcar][cDescription],256,"%s",result);
Probably not the best method, but it will work.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)