06.01.2015, 22:50
Yeah, that was what I wanted, the code would be;
and at the end of your script, place this;
No problem, this should work.
Edit: Eh, sorry about the indentation mistakes as it is hard to write a script at forums.
pawn Код:
CMD:forcerules(playerid,params[])
{
new targetID,string[128],pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME];
if(User[playerid][accountAdmin] == 0) return SendClientMessage(playerid,-1,"You are not authorized enough.");
if(sscanf(params,"i",targetID)) return SendClientMessage(playerid,-1,"[USAGE]: /forcerules [player ID]");
if(!IsPlayerConnected(targetID)) return SendClientMessage(playerid,-1,"You have specified an incorrect ID.");
else
{
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(targetID,tName,sizeof(tName));
format(string,sizeof(string),"%s has forced you to view the /rules!",pName);
SendClientMessage(targetID,-1,string);
format(string,sizeof(string),"%s has forced %s to view the rules!",pName,tName);
AdminMessage(-1,string);
// Put your /rules messages/dialogs here.
}
return 1;
}
pawn Код:
forward AdminMessage(color, string[]);
public AdminMessage(color,string[])
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(User[i][accountAdmin] >= 1)
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
Edit: Eh, sorry about the indentation mistakes as it is hard to write a script at forums.

