i think its strings? - 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)
+--- Thread: i think its strings? (
/showthread.php?tid=455322)
i think its strings? -
kaos999 - 01.08.2013
hello i created a command /skydive and it works fully
but now i want 2 add if a player teleports there his/hers name will appear in the messages saying
"player has used /skydive" (player=meaning the players name that has teleported)
Код:
dcmd_skydive(playerid, cmdtext[]) {
#pragma unused cmdtext
SetPlayerPos(playerid, 1545.5846,-1352.5847,329.4822);
GivePlayerWeapon(playerid,46,1);
SendClientMessage(playerid, COLOR_ORANGE,"[XLGW]:WELCOME TO SKYDIVE");
return 1;
this the command how can i add it 2 this ??
please explain what you have done as well and please do it in step by step
Re: i think its strings? -
Bakr - 01.08.2013
You will have to
format a string after
getting the player's name and send it via
SendClientMessageToAll.
Edit: Or just have someone come along and do all the work for you.
Re: i think its strings? -
RajatPawar - 01.08.2013
To do this - you need to use the
format function. It modifies "a string to include variables and other strings inside it. (at runtime)" So you would do something like:
pawn Код:
dcmd_skydive(playerid, cmdtext[]) {
#pragma unused cmdtext
SetPlayerPos(playerid, 1545.5846,-1352.5847,329.4822);
GivePlayerWeapon(playerid,46,1);
new name[24], string[128];
GetPlayerName(playerid, name, 24);
format(string, 128, "%s (%d) has sky dived.", name, playerid);
SendClientMessageToAll(COLOR_ORANGE, string);
return 1;
}
Read the wiki.samp.com and ****** for more information.
Re: i think its strings? -
kaos999 - 01.08.2013
THANK YOU SOO MUCH U ROCK