SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/10/2018, 10:04 PM   #11
Jefff
Banned
 
Join Date: Dec 2007
Posts: 2,598
Reputation: 326
Default Re: warning 224: indeterminate array size in "sizeof" expression (symbol "maxlength")

pawn Code:
public OnPlayerText(playerid, text[])
{
    TestText(text,strlen(text));
    return 0;
}

CMD:test(playerid, params[])
{
    new text[90];
    if(sscanf(params, "s[90]", text)) return SendClientMessage(playerid,-1, "/test (text)");
   
    TestText(text); // text is 90 so you dont need pass sizeof
    new str[90]; format(str, sizeof(str), "%s", text);
    SendClientMessageToAll(-1, str);
    return 1;
}

TestText(text[], s_size = sizeof(text))
{
    strreplace(text, "test_01", "replace_01", .maxlength = s_size);
    strreplace(text, "test_02", "replace_02", .maxlength = s_size);
    return 1;
}
Jefff is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command warning (params) warning 224: indeterminate array size in "sizeof" expression (symbol "maxlength") Riwerry Scripting Help 1 24/05/2014 10:54 PM
warning 224: indeterminate array size in "sizeof" expression (symbol "") Fierro Scripting Help 7 12/10/2013 02:59 PM
"Must be a constant expression; assumed zero","Array dimensions do not match" Fierro Scripting Help 0 08/09/2013 10:11 PM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 12:08 PM
[SOLVED]warning 224: indeterminate array size in "sizeof" expression (symbol "") LarzI Help Archive 2 22/12/2009 04:32 AM


All times are GMT. The time now is 07:26 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.