SA-MP Forums Archive
Command issue. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Command issue. (/showthread.php?tid=161433)



Command issue. - Faith - 20.07.2010

Hi,

I am having this issue as i'm not quite used to tmp's etc.
However, I would like to make a command for players, to save a players phonenumber and name into a file.

But as you may see, the tmp's are for ID and numbers only.
The numbers saves fine, but i can't figure out how to save the name into a file, as it currently only works for numbers, hence strval(tmp).

I couldn't seem to find the code/function that i am needing.
I am looking forward for your assistance.

Thank you.


Код:
	if(strcmp(cmd, "/addfavorites", true) == 0) {
	    new tmp[256];
	    
	    
 		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /AddFavorites [Number] [Name]");
			return 1;
		}
  		new phonenumber = strval(tmp);

		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp)) {
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /AddFavorites [Number] [Name]");
			return 1;
		}
		new nametext = strval(tmp);



Re: Command issue. - Jefff - 20.07.2010

Remove
new nametext = strval(tmp);
and name is as tmp

format(....phone %d, name %s,phonenumber,tmp);


Re: Command issue. - Faith - 20.07.2010

arh, thanks.