How i should make sendclientmessage for me and target
#1

I tried send message like if i type
/setammo i got message you sent ammo for Target_Name and that Target_Name get message like this You got ammo from Player_Name

I hope you understand what i mean i tried make bat its always luck like this
You send ammo for Player_Name (like send ammo for me self, bat i didn't)
You got ammo from Player_Name i tried make killerid bat still happen shit level stuff.
Reply
#2

Show your code first and we will help you. That how that works.
Reply
#3

Show us what you've got so far, we will re-create the code.
Reply
#4

Quote:
Originally Posted by saffierr
Посмотреть сообщение
Show us what you've got so far, we will re-create the code.
Why would you repeat what the person above already said?
Reply
#5

Your code ?
Reply
#6

Quote:
Originally Posted by oktokt1
Посмотреть сообщение
Sorry but why you guys need code ?
Just try it
Код:
new name1[28],name2[28],str1[250],str2[250];
format(str1, sizeof(str1),"You sent ammo to %s(%d)",GetPlayerName(target,name2,28),target);
SendclientMessage(playerid,0xFFFF33,str1);
format(str2, sizeof(str2),"Player %s(%d) sent you ammo.",GetPlayerName(playerid,name2,28),playerid);
SendclientMessage(target,0xFFFF33,str2);
Try it
IF I make any mistake please fix it guys I did it with phone
Sorry, But this code is real shit ..
There is a lot of mistakes in this code, Two strings are not necessary only one is enough for many formats, The size of the string is TOO much, It doesn't even reach 60, GetPlayerName shouldn't be used like that, MAX_PLAYER_NAME is 25, I don't see why you put it 28.
Reply
#7

Quote:
Originally Posted by oktokt1
Посмотреть сообщение
Sorry but why you guys need code ?
Just try it
Код:
new name1[28],name2[28],str1[250],str2[250];
format(str1, sizeof(str1),"You sent ammo to %s(%d)",GetPlayerName(target,name2,28),target);
SendclientMessage(playerid,0xFFFF33,str1);
format(str2, sizeof(str2),"Player %s(%d) sent you ammo.",GetPlayerName(playerid,name2,28),playerid);
SendclientMessage(target,0xFFFF33,str2);
Try it
IF I make any mistake please fix it guys I did it with phone
PHP код:
new name1[28],name2[28
dude oktokt
you've to write it like this :
PHP код:
 new name1[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME]; 
as oMa37 said.
Reply
#8

Its dont even get name its just show id
So its luck (You sent ammo to 0)
Код:
    format(str, sizeof(str),"You sent ammo to %s(%d)",GetPlayerName(target,name2,28),target);
    SendClientMessage(playerid,0xFFFF33,str);
    format(str, sizeof(str),"Player %s(%d) sent you ammo.",GetPlayerName(playerid,name2,28),playerid);
    SendClientMessage(target,0xFFFF33,str);
Reply
#9

PHP код:
new str[40], pname[24], name2[24];
GetPlayerName(target,name2,sizeof(name2));
GetPlayername(playeridpnamesizeof(pname));
format(strsizeof(str),"You sent ammo to %s(%d)",name2,target);
SendClientMessage(playerid,0xFFFF33,str);
format(strsizeof(str),"Player %s(%d) sent you ammo.",pname,playerid);
SendClientMessage(target,0xFFFF33,str); 
Reply
#10

Ok bat now duplicate message its sends two times
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)