SA-MP Forums Archive
Help error 047 - 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)
+--- Thread: Help error 047 (/showthread.php?tid=487763)



House system made my server crash - YahyaBR - 15.01.2014

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


Re: Help error 047 - InglewoodRoleplay - 15.01.2014

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


Re: Help error 047 - Sawalha - 15.01.2014

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


Re: Help error 047 - YahyaBR - 15.01.2014

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


Re: Help error 047 - ACI - 15.01.2014

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.


Re: Help error 047 - YahyaBR - 15.01.2014

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


Re: Help error 047 - YahyaBR - 15.01.2014

bump anyone?


Re: Help error 047 - YahyaBR - 15.01.2014

Bump, sorry for triple post but i still need help


Re: Help error 047 - YahyaBR - 16.01.2014

Bump, i still need help please.