Help with variable
#1

Hi all. Have problem with code. I have this:
Код:
stock CreateFraction(FractionName[], Float:EnterX, Float:EnterY, Float:EnterZ, id, lvl, skini, uzdyrba,galininka[],spalv[],koma[], virtualus =0)
{
	new fquery[100];
	format(workInfo[workid][nam], 100, "%s", FractionName);
	format(workInfo[workid][spalva], 7, "%s", spalv);
	format(workInfo[workid][galininkas], 100, "%s", galininka);
	format(workInfo[workid][komanda], 20, "%s", koma);
	workInfo[workid][jobid] = id;
	workInfo[workid][skinid] = skini;
	workInfo[workid][lvlneed] = lvl;
	workInfo[workid][uzdirba] = uzdyrba;
	workInfo[workid][checkpointidx] = CreatePickupA(1275 ,2, EnterX, EnterY, EnterZ,virtualus);
	format(fquery,sizeof(fquery),"SELECT * FROM `darbai` WHERE `id` = '%i'",id);
	mysql_function_query(MysqlConnection,fquery,true,"DarbuLoad","d",workid);
	workid ++;
	return 1;
}
And then after server start
Код:
CreateFraction("FracName", 237.2637,110.7220,8000.2188, 0, 20000, 0,0,"test","E55B3C","/test");
This code working good. But now I trying to this:
Код:
CreateFraction("%i", 237.2637,110.7220,8000.2188, 0, 20000, 0,0,"test","E55B3C","/test",myname);
And I getting error: argument type mismatch. Is it possible, to use FractionName from variable, like I trying to do?
Reply
#2

format a string buddy

Код:
new mystring[24];
format(mystring, sizeof(mystring, "%i", myname); //If it's a string, it should be %s though
CreateFraction(mystring, 237.2637,110.7220,8000.2188, 0, 20000, 0,0,"test","E55B3C","/test");
This should work..


EDITTED: Had a mistake, try again now..
Reply
#3

Using this code - no errors, but code doesn't work. Text does not appear :/
Reply
#4

Read the comment,it should be %s if it's a name.
Reply
#5

Dayum, please rep if it helped, I'm in desperate need of reputation to advertise the server I will be HAVING in future :/


Btw how much rep do i need to post in the ADVERTISEMENT SUBFORUM?
Reply
#6

I using %s, not %i and still no text...
Reply
#7

If you want the fraction to be created with your name like ",TomY"

Код:
new mystring[24], myname[24];
GetPlayerName(playerid, myname, 24);
format(mystring, sizeof(mystring, "%s", myname); //If it's a string, it should be %s though
CreateFraction(mystring, 237.2637,110.7220,8000.2188, 0, 20000, 0,0,"test","E55B3C","/test");
[/CODE]
Reply
#8

Quote:
Originally Posted by div
Посмотреть сообщение
Dayum, please rep if it helped, I'm in desperate need of reputation to advertise the server I will be HAVING in future :/


Btw how much rep do i need to post in the ADVERTISEMENT SUBFORUM?
begging does not get you true rep lol. You need 15 rep for advertisement. Dont beg for rep and have some self respect. If people wanna give you rep, they will if dont, then its not a big deal. rep isnt money. rep is rep on SAMP forums which is useless in rest of the world.
Reply
#9

Still need help. This code does not working for me.. Pickup appears, but text - no.
Reply
#10

Post the function of CreatePickupA.
Or you should create pickup like normal using CreatePickup or CreateDynamicPickup.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)