help with string
#1

hello i need help wit string ima no idea how to place it right...


Код:
public OnPlayerRequestClass(playerid, classid)
{
	new string[768];
	PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
	PlayerInfo[playerid][pModel] = Peds[classid][0];
    if(IsPlayerNPC(playerid))
	{
	    SpawnPlayer(playerid);
		return 1;
	}
	if (RegistrationStep[playerid] == 0 && gPlayerLogged[playerid] != 1)
	{
// =========================================================
        PlayerPlaySound(playerid, 1185, 0.0, 0.0, 0.0);
	    SetPlayerCameraPos(playerid,1460.0, -1324.0, 287.2);
	    SetPlayerCameraLookAt(playerid,1374.5, -1291.1, 239.0);
	    Camera[playerid] = 1;
	    CameraX[playerid] = 1460.0;
	    CameraY[playerid] = -1324.0;
	    CameraZ[playerid] = 287.2;
//=========================================================

        ClearChatbox(playerid, 10);
        format(string, sizeof(string), "Welcome To {00FF00}Evolution Roleplay", Version);
		SendClientMessage(playerid, COLOR_YELLOW, string);
		SendClientMessage(playerid, COLOR_YELLOW2, " ");
		new message[] = "\t\t\t\t\t\t Evolution Roleplay Terms and Conditions \n\n\n\n\n\n 1- This server contains adult content. You agree that you have the legal age in your country to be exposed to such material\n\n 2- This server does not allows Hacks, you agree that you are not going to use any third party program in order to get any advantage.";
		new message2[] = "\n\n 3- By Reading this, you agree to Follow all server /rules with risk of being kicked or banned by breaking them.\n\n 4- By reading this you also agree that you will obey administrators ALWAYS, unless it breaks any term (1) (2) (3) (5). \n\n 5- This server obeys the Terms and Conditions made by the SA:MP Team at www.sa-mp.com/service_agreement \n\n\n Press on 'Agree' If you Agree, 'Refuse' If you refuse.";
		format(string, sizeof(string),"%s %s",message,message2);
		ShowPlayerDialog(playerid,1244,DIALOG_STYLE_MSGBOX,"Evolution RP Terms and Conditions",string,"Agree","Refuse");
		PlayerInfo[playerid][pModel] = Peds[classid][0];
		SetPlayerTeamFromClass(playerid,classid);

//=========================================================

	    SetPlayerCameraPos(playerid,755.1537,-1592.8079,70.7801);
	    SetPlayerCameraLookAt(playerid,755.1537,-1592.8079,70.7801);
	    Camera[playerid] = 1;
	    CameraX[playerid] = 755.1537;
	    CameraY[playerid] = -1592.8079;
	    CameraZ[playerid] = 70.7801;
	    new Welcomemessege;
   		Welcomemessege = string[256], Welcomemessege[MAX_PLAYER_NAME];
		GetPlayerName(playerid,name,sizeof(Welcomemessege));
		format(string,256,"~k~Welcome %s !",Welcomemessege);
		GameTextForPlayer(playerid,Welcomemessege,10000,6);
//=========================================================
	}
	else
	{
		SpawnPlayer(playerid);
	}
	return false;
}
ERrors:

Код:
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(18779) : error 028: invalid subscript (not an array or too many subscripts): "Welcomemessege"
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(18779) : warning 215: expression has no effect
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(18779) : error 001: expected token: ";", but found "]"
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(18779) : error 029: invalid expression, assumed zero
C:\Users\MaticKepa\Desktop\Real Life ENG\gamemodes\Mazda.pwn(18779) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

pawn Код:
new Welcomemessege[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(Welcomemessege,sizeof(Welcomemessege),"~k~Welcome %s !",name); //~k~ is not a valid color , you have to replace it
GameTextForPlayer(playerid,Welcomemessege,10000,6);
Reply
#3

~k~ is gametext styl or?
Reply
#4

No.
k stands for Key!

Код:
~r~    red
~g~    green
~b~    blue
~w~    white
~y~    yellow
~p~    purple
~l~    black
~n~    new line
~h~    lighter color
Reply
#5

ty fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)