#1

Okay, so I have this code. But when I mute lets say player id 1 it still
says my name instead of player 1's name.

Код:
if(dialogid == 9)
{
if (response)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string, sizeof(string), "%s has been muted by an Admin", name);
format(message, sizeof(message), "Reason : %s", inputtext);
SendClientMessageToAll(red,string);
SendClientMessageToAll(blue,message);
format(string, sizeof(string), "You have sucessfully muted %s", name);
SendClientMessage(playerid, lightblue,string);
}
}
Problem: I can't make it say the player that is being muted, it
only says the muters name.

________
Toyota ad engine specifications
Reply
#2

GetPlayerName(playerid,name,sizeof(name));

Theres your problem,
Reply
#3

Quote:
Originally Posted by Joe Torran C
GetPlayerName(playerid,name,sizeof(name));

Theres your problem,
What will I substitute to playerid
________
Yamaha qt50 specifications
Reply
#4

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:
Originally Posted by Joe Torran C
GetPlayerName(playerid,name,sizeof(name));

Theres your problem,
What will I substitute to playerid
the variable you used to store the players id.
Reply
#5

pawn Код:
new tmp[128];
new target[MAX_PLAYER_NAME];
if(dialogid == 9)
{
if (response)
{
tmp = strtok(cmdtext, idx);
target = ReturnUser(tmp);
GetPlayerName(target,target,sizeof(target));
format(string, sizeof(string), "%s has been muted by an Admin", target);
format(message, sizeof(message), "Reason : %s", inputtext);
SendClientMessageToAll(red,string);
SendClientMessageToAll(blue,message);
format(string, sizeof(string), "You have sucessfully muted %s", target);
SendClientMessage(playerid, lightblue,string);
}
}
Reply
#6

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:
Originally Posted by Joe Torran C
GetPlayerName(playerid,name,sizeof(name));

Theres your problem,
What will I substitute to playerid
On the top of your script

pawn Код:
new MutedID;
And then on the dialog where the player enters the id

pawn Код:
format(MutedID, sizeof MutedID, "%s", inputtext);
And then on your GetPlayerName

pawn Код:
GetPlayerName(MutedID, name, sizeof name);
If that dosent work try putting [MAX_PLAYERS] on the new on top of script,

And in format add [playerid] to the both MutedID, and a [playerid] on the GetPlayerName MutedID
Reply
#7

Okay, okay. Thank you very much
________
Water bongs
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)