i think its strings?
#1

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
Reply
#2

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.
Reply
#3

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.
Reply
#4

THANK YOU SOO MUCH U ROCK
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)