What is wrong?
#1

Hi all.I need some help with my very little script here is :

Код:
PlayerData[playerid][PhoneNumber] = String;
And why i get this error:

Код:
C:\Documents and Settings\Owner\Desktop\SAMP Serveris\gamemodes\SF.pwn(928) : error 006: must be assigned to an array
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Show where you declare the variable "PlayerData[playerid][PhoneNumber]".

This may help.

pawn Код:
strcat(PlayerData[playerid][PhoneNumber], String);
or this is safer.
pawn Код:
format(PlayerData[playerid][PhoneNumber], sizeof(PlayerData[playerid][PhoneNumber]), "%s", String);
Use the first version (strcat) if "PlayerData[playerid][PhoneNumber]" is an empty array.

Use the second version (format) if "PlayerData[playerid][PhoneNumber]" holds/may hold data.

Remember you can't assign strings like you do with ints ect. Ie, String = value, will not work.
Reply
#3

Don't work maybe you can help me:

Код:
new String [ 15 ];
format ( String, 15, "+370%d%d%d%d%d%d%d%d"HERE IS RANDOM CODE);
And now how to set this get code:to this:

Код:
PlayerData[playerid][PhoneNumber]?
I try:

Код:
strcat(PlayerData[playerid][PhoneNumber], String);
but don't work
Reply
#4

PHP код:
format(PlayerData[playerid][PhoneNumber], 15"+370%d%d%d%d%d%d%d%d"HERE IS RANDOM CODE); 
Reply
#5

pawn Код:
PlayerData[playerid][PhoneNumber] = strval(String);
'PhoneNumber' is quite clearly an integer... Remove the +370 or turn 'PhoneNumber' in to a string.
Reply
#6

I try to do MoroDan way and your way but don't work..
Reply
#7

Thank you: Calg00ne
Reply
#8

One problem more: I have do in my server receiveid messages,and if any body send my message it's save and i can look that message with dialog.But problem is always in one line,and overwrite,here if any write my it's will look like that:

Код:
+37052148971 - Big_Killer
And if another player send my message it's overwrite on previously received message,but i want to do like that:

Код:
+37052148971 - Big_Killer
+37099521737 - Another_Player
Reply
#9

Show the code.
Reply
#10

Код:
if(dialogid == 9229)
	{
	if(response)
	{
	if(listitem == 0)
	{
	if( PlayerData[ playerid ][ GautuSkaicius ] > 0)
	{
	new StringSet [ 55 ];
	format(StringSet,sizeof(StringSet),"{FFFFFF}+370%d - %s : %s...",PlayerData[playerid][PhoneNumber],PlayerData[playerid][SenderName],strlen(PlayerData[playerid][PhoneMessage]));
	ShowPlayerDialog(playerid,9230,DIALOG_STYLE_LIST,"Gautos zinutes",StringSet,"Ziureti","Atgal");
	}
	}
	return 1;
	}
And there where is PhoneMessage i get wrong message,maybe somebody can show me how to format message here i try:

Код:
PlayerData[SenderID][PhoneMessage] = strlen( MessageID );
I get message,but i want to do other way,I want to see about 7 letters of all message is this ismosible?But this is second question.Important is 1.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)