SA-MP Forums Archive
I need help with something.. - 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: I need help with something.. (/showthread.php?tid=92812)



I need help with something.. - _Vortex - 22.08.2009

Now, I said "something" because I'm not 100% sure on how to explain it.

But on gamemodes and stuff, I see "SendClientMessage(playerid,color,"%d has reported %d for %d");" etc, but I would like someone to explain exactly how to make it show stuff like that, because I've never used that, and I cant find a wiki page about it either.

Can someone explain it to me or if there is a wiki page for it, tell me the link?

Thanks


Re: I need help with something.. - SampStunta - 22.08.2009

Its because someone just reported another player for that reason....

Like on servers

/report [playerid] [reason]

Make a commands with the functions for it


Re: I need help with something.. - _Vortex - 22.08.2009

Quote:
Originally Posted by SampStunta
Its because someone just reported another player for that reason....

Like on servers

/report [playerid] [reason]

Make a commands with the functions for it
I'm not just talking about a report command, I'm using that as an example.

I'm asking how I can do stuff like that.


Re: I need help with something.. - SampStunta - 22.08.2009

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/[Enter your command]", cmdtext, true, 10) == 0)
	{
		[Functions here]
		return 1;
	}
	return 0;
}



Re: I need help with something.. - Abernethy - 22.08.2009

Strings?
pawn Код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name)); // Gets the players name.
format(string, sizeof(string), "%s ate a peanut off the table. (ID:%d)", name, playerid); // Formatting the message you want to send. %s is the name & %d is the players ID.
SendClientMessageToAll(0xFFFFFFFF, string);



Re: I need help with something.. - _Vortex - 22.08.2009

Quote:
Originally Posted by Abernethy
Strings?
pawn Код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name)); // Gets the players name.
format(string, sizeof(string), "%s ate a peanut off the table. (ID:%d)", name, playerid); // Formatting the message you want to send. %s is the name & %d is the players ID.
SendClientMessageToAll(0xFFFFFFFF, string);
Thanks

EDIT: How would i make it get 2 different players names and ids?


Re: I need help with something.. - Abernethy - 22.08.2009

Quote:
Originally Posted by [B
Vortex ]
Quote:
Originally Posted by Abernethy
Strings?
pawn Код:
new string[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name)); // Gets the players name.
format(string, sizeof(string), "%s ate a peanut off the table. (ID:%d)", name, playerid); // Formatting the message you want to send. %s is the name & %d is the players ID.
SendClientMessageToAll(0xFFFFFFFF, string);
Thanks
No problem. By the way, SampStunter you just made yourself look like a huge noob. I don't know if you can't read English too well, but it really isn't hard to understand what he wanted.

@Vortex: Like so...
pawn Код:
new string[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s ate a peanut off %s's table.", name, name2);
SendClientMessageToAll(0xFFFFFFFF, string);



Re: I need help with something.. - _Vortex - 22.08.2009

Quote:
Originally Posted by Abernethy
@Vortex: Like so...
pawn Код:
new string[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s ate a peanut off %s's table.", name, name2);
SendClientMessageToAll(0xFFFFFFFF, string);
I'm still having trouble understanding exactly, do you have msn? D:


Re: I need help with something.. - Dark_Kostas - 22.08.2009

Quote:
Originally Posted by Abernethy
pawn Код:
new string[128], name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(secondplayerid, name2, sizeof(name2));//you forgot to get the 2nd player's name
format(string, sizeof(string), "%s ate a peanut off %s's table.", name, name2);
SendClientMessageToAll(0xFFFFFFFF, string);
Also read THIS to help you understand how string works.