Posts: 564
Threads: 149
Joined: Jan 2011
Reputation:
0
What you mean?
Can I have an example to get my solution?
Posts: 6,129
Threads: 36
Joined: Jan 2009
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 38) {
new name[MAX_PLAYER_NAME];
new str[128];
GetPlayerName(killerid, name, sizeof(name));
format(str, sizeof(str),"%s is suspected of having a weapon hack (Minigun).", name);
SendClientMessageToAdmins(0xFFFFFFAA, string);
}
return 1;
}
You need to properly use brackets after if statements. The only thing your code did was create 'name' if killerid had weapon 38, because if you don't include brackets for a statement, it processes the lines up to the nearest semi-colon ( ; ), so it'd have only done:
pawn Код:
new name[MAX_PLAYER_NAME];
Posts: 564
Threads: 149
Joined: Jan 2011
Reputation:
0
How can I make this:
If the player is in some specific place like minigun minigame then dont send the message.?
Posts: 836
Threads: 107
Joined: Sep 2010
Reputation:
0
In his case, the brackets were the problem. But if he wants when a player types /mg they get a minigun but don't get banned, then he can use your way.