number of arguments doesn't match the definition
#1

Код:
			else if(GetIntVar(playerid, "CallWith") == 8736)
			{
				format(str, sizeof(str), "%s spune (telefon) %s", GetNameWithMask(playerid), text);
				ProxDetectorP(20.0, playerid, str,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
				if(!strlen(text))
				{
					SCM(playerid, COLOR_LIGHTBLUE, "Locul livrarii, catre afacere, poate tine un minim de 1.000 materiale si un maxim de 50.000");
					return 0;
				}
				SCM(playerid, COLOR_WHITE, "Va putem oferi aceste materiale la pretul de $%d", strlen(text) * 55);
				SCM(playerid, COLOR_WHITE, "Sunteti de acord ? (Da sau Nu)");
				PlayerInfo[playerid][pMaterialeWait] = strlen(text);
				PlayerInfo[playerid][pMaterialeWait] = 1;
				SetIntVar(playerid, "CallWith", 8737);
				return 0;
			}
I have this warning at this line:
Код:
SCM(playerid, COLOR_WHITE, "Va putem oferi aceste materiale la pretul de $%d", strlen(text) * 55);
I think strlen(text) * 55); is wrong..what i need to edit ?
Reply
#2

Format the string first
pawn Код:
format(str, sizeof str, "Va putem oferi aceste materiale la pretul de $%d", strlen(text) * 55);
SCM(playerid, COLOR_WHITE, str);
Reply
#3

Copy the line where SCM is defined. I guess it's a alias for SendClientMessage (that has 3 arguments), so that strlen thing doesn't belong in there. You need for format the string manually.
Reply
#4

Oh..thank you very much..
I have a question.. at strlen(text) * 55); can i replace with text * 55 or is corect like that..
Reply
#5

Strlen checks the length of the text, so if you wrote "hi" it would basically be "2 * 55", while using "text * 55" would do "hi * 55", which wont work.
Reply
#6

But i have a question there :"How many materials do you want to buy" ?
And when player write 1000 to update this :

PlayerInfo[playerid][pMaterialeWait] = strlen(text);

What i need to put there ? = strlen(text);

If player write 1000 i wan't something like that:
PlayerInfo[playerid][pMaterialeWait] = 1000
Reply
#7

Wrong function! strval - changes text into number, strlen - counts the number of characters in string
Reply
#8

After i need to put PlayerInfo[playerid][pMaterialeWait] = text; aight ?
Reply
#9

If pMaterialeWait is an integer, then
pawn Код:
PlayerInfo[playerid][pMaterialeWait] = strval(text);
Reply
#10

So, strval is not a counting right ? Is not like strlen..
If player write 1000
pMaterialeWait = strval(text); and strval(text) is 1000 right ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)