Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

Set the size of an array based on another

Hello, I know that the size of an array must be defined by a constant, but is there any way to define the size based on a...

ID
d6ouivnilegovhg7c4j0
author
jr_junior's avatar

JR_Junior

@jr_junior


View profile
Copy link
  Report member
started
Jun 7, 2024
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
Set the size of an array based on another
jr_junior's avatar

JR_Junior

@jr_junior


View profile
Copy link
  Report member
• 2y
Pawn Scripting

Set the size of an array based on another

pawn

Hello, I know that the size of an array must be defined by a constant, but is there any way to define the size based on a parameter or another array?

stock GetStringPreview(string[],maxlength=25)
{
new preview,len;
format(preview,maxlength,"%s",string);
if(strlen(string) > maxlength)
{
len = strlen(preview);
strins(preview, "...",((preview == ' ') ? len-1 : len));
}
return preview;
}
0 likes0 replies

    Please sign up or log in to reply