Help - 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: Help (
/showthread.php?tid=144978)
Help -
ViruZZzZ_ChiLLL - 30.04.2010
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
Re: Help -
Torran - 30.04.2010
GetPlayerName(
playerid,name,sizeof(name));
Theres your problem,
Re: Help -
ViruZZzZ_ChiLLL - 30.04.2010
Quote:
Originally Posted by Joe Torran C
GetPlayerName(playerid,name,sizeof(name));
Theres your problem,
|
What will I substitute to playerid
________
Yamaha qt50 specifications
Re: Help -
Think - 30.04.2010
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.
Re: Help -
Adil - 30.04.2010
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);
}
}
Re: Help -
Torran - 30.04.2010
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
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
Re: Help -
ViruZZzZ_ChiLLL - 30.04.2010
Okay, okay. Thank you very much
________
Water bongs