28.08.2011, 18:56
pawn Код:
new Ranks[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
Ranks[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid)
{
Ranks[playerid] = 0;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerScore(killerid) == 1) {
SendClientMessage(killerid,-1,"SERVER: You just ranked up to 1 :D");
Ranks[killerid] = 1;
}
return 1;
}
// now try to make something if player is rank 1
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/weaponrank1", cmdtext, true, 10) == 0) {
if(Ranks[playerid] == 1) {
GivePlayerWeapon(playerid,24,1000);
}
else {
SendClientMessage(playerid,-1,"SERVER: You are not rank 1 :)");
}
return 1;
}
return 0;
}