#1

I have this code
Код:
new age[MAX_PLAYERS];//TOP
CMD:myage(playerid, params[])
{
	new myage, str[180];
	if(sscanf(params, "i", myage)) return SCM(playerid, -1, "USAGE:/myage[age]");
	format(str, sizeof(str), "Your Age Have Been Set To %i", myage);
	SCM(playerid, -1, str);
	age == myage;
	return 1;

}
I Have This Errors :
Код:
C:\Users\Kurdi's\Desktop\samp037_svr_R2-1-1_win32\gamemodes\FirstCode.pwn(177) : error 033: array must be indexed (variable "age")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Error Line:
[CODE]
Код:
new age[MAX_PLAYERS];
Reply
#2

pawn Код:
age == myage;
You want to assign myage to age of current player. So, first:
== is comparison, = is assignment
pawn Код:
age = myage;
Well, this is still not good. You want to set only current player age. So:
pawn Код:
age[playerid] = myage;
Reply
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
age == myage;
You want to assign myage to age of current player. So, first:
== is comparison, = is assignment
pawn Код:
age = myage;
Well, this is still not good. You want to set only current player age. So:
pawn Код:
age[playerid] = myage;
Thanks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)