08.08.2014, 03:52
pawn Код:
#include <a_samp>
new OldUsername[MAX_PLAYER_NAME][MAX_PLAYERS];
new bool:Masked[MAX_PLAYERS] = false;
public OnPlayerText(playerid, text[])
{
if(Masked[playerid])
{
new string[128];
format(string, sizeof(string), "Stranger says, \"%s\"", text);
SendClientMessage(playerid, -1, string);
return 0;
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
{
if(!strcmp(cmdtext, "/mask")){
if(isStranged[playerid] == 0)
{
new randomID = random(200);
new string[35];
isStranged[playerid] = true;
GetPlayerName(playerid, string, sizeof(string));
strmid(OldUsername[playerid], string, 0, strlen(string), 64);
format(string,sizeof(string), "Stranger", randomID);
SetPlayerName(playerid, string);
SetPlayerAttachedObject(playerid, 1, 19037, 2, 10, 4.7, 0.0, 90, 90, 0);
SendClientMessage(playerid, -1, "You have put on a mask! (/mask to romove it)");
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
}
else
{
SetPlayerName(playerid, OldUsername[playerid]);
isStranged[playerid] = false;
SendClientMessage(playerid, -1, "You have removed your mask!");
if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid, 1);
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
return true;
}
return 1;
}