Help error 047
#1

Hey, i just downloaded cali's house system but i have a problem while compiling it.

I get these errors
Quote:

E:\Samp Server\AAD\filterscripts\cali-houses.pwn(223) : error 047: array sizes do not match, or destination array is too small
E:\Samp Server\AAD\filterscripts\cali-houses.pwn(593) : error 047: array sizes do not match, or destination array is too small
E:\Samp Server\AAD\filterscripts\cali-houses.pwn(710) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Errors.

I have no idea what's that error means, here are the error lines

Line 223:
Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[128], idx;// This is line 223
cmd = strtok(cmdtext, idx);
if(!strcmp(cmdtext, "/buyhouse", true))
{ // Buying house.
if(HouseOwner[playerid] == false)
{
if(IsSettingUpHouse[playerid] == false)
{
ShowPlayerDialog(playerid, 666, DIALOG_STYLE_MSGBOX, "Confirmation", "You are about to create your very own house.\n\nPress 'Continue' to start.", "Continue", "Cancel");
}
else
{
SendClientMessage(playerid, 0xE21F1FFF, "You are already setting up your house.");
return 1;
}
}
else
{
SendClientMessage(playerid, 0xE21F1FFF, "You already own a house.");
return 1;
}
return 1;
}


Line 593:
Quote:

if(strcmp(cmd, "/approvehouse", true) == 0)
{ // Accepting house.
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Unknown command.");
new tmp[128], giveplayerid;
tmp = strtok(cmdtext, idx);//Line 593
if(!strlen(tmp)) {
SendClientMessage(playerid, 0xE21F1FFF, "USAGE: /approvehouse [playerid/PartOfName]");
return 1;
}



Line 710:
Quote:

if(strcmp(cmd, "/denyhouse", true) == 0)
{ // Deny house.
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid, 0xFFFFFFAA, "SERVER: Unknown command.");
new tmp[128], giveplayerid;
tmp = strtok(cmdtext, idx);//Line 710
if(!strlen(tmp)) {
SendClientMessage(playerid, 0xE21F1FFF, "USAGE: /denyhouse [playerid/PartOfName]");
return 1;
}


Thanks



EDIT:
I have changed the commadns to ZCMD, but now my server crashed when i use the /buyhouse command
I made a pastebin of the whole filterscript: http://pastebin.com/fL8g7DAd
Reply
#2

Change to YCMD, ZCMD or CMD. This type of command system is deprecated.
If you still want to use this, read on how to use strtok to correct any errors.
https://sampwiki.blast.hk/wiki/Strtok
Reply
#3

Incorrect you are doing, tmp has 256 size, and cmd has 256 size too...
Reply
#4

I did changed all the tmp size to 256, compiled without any errors and warnings.
But i tried it ingame, my server crashed everytime i did /buyhouse
Reply
#5

SA-MP has limitations. You cant go more than 128 cells!
I think you're returning 1 at many places in the command /buyhouse. You can do it once.
Reply
#6

Hmmm, this is what i did
I changed all 256 back to 128
I change strtok thing to zcmd
And i deleted returns in buyhouse

No errors and warnings, but when i did /buyhouse it crash just like before

I made a pastebin of the whole filterscript: http://pastebin.com/fL8g7DAd
Reply
#7

bump anyone?
Reply
#8

Bump, sorry for triple post but i still need help
Reply
#9

Bump, i still need help please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)