ta ai:
pawn Code:
|
public OnPlayerDeath(playerid, killerid, reason) { SendDeathMessage(killerid, playerid, reason); if (gdebug >=0){printf("OnPlayerDeath Playerid:%d killerid:%d reason:%d", playerid, killerid, reason);} new name[MAX_PLAYER_NAME]; new string[256]; new dmessage[128]; new deathreason[20]; new playercash; new victimteam; new Floatx,Floaty,Floatz; //new killerteam; victimteam = (gTeam[playerid]); //killerteam = (gTeam[killerid]); gPlayerSpawned[playerid] = 0; GetPlayerName(playerid, name, sizeof(name)); PlayerInfo[playerid][pLocal] = 255; GetPlayerPos(playerid, px, py, pz); if (EventsProxDetectorV(100.0, playerid, 254) || EventsProxDetectorV(100.0, playerid, 255) || EventsProxDetectorV(100.0, playerid, 256)) { for (new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && (i != playerid)) { new tmpcar = GetPlayerVehicleID(i); if (tmpcar >= 254 && tmpcar <= 256) { if (PlayerHaul[tmpcar][pLoad] > 0) { PlayerInfo[i][pWA]++; if(PlayerInfo[i][pWA] >= 20) { PlayerInfo[i][pExp]++; PlayerInfo[i][pWA] = 0; SendClientMessage(i, COLOR_YELLOW, "ganhou +1 exp"); } PlayerHaul[tmpcar][pLoad]--; GiveMoney(playerid, 5000); } } } } SendDeathMessage(killerid, playerid, reason); } if(killerid != INVALID_PLAYER_ID) { new oldlevel; new newlevel; //oldlevel = GetPlayerWantedLevel(killerid); oldlevel = PlayerInfo[killerid][pWantedlevel]; newlevel = oldlevel + 1; SetPlayerWantedLevel(killerid, newlevel); ADBy(playerid, killerid, reason); Score[killerid]++; } if(gPlayerFighter[playerid] == 1) { DmScore[playerid]--; if(killerid != INVALID_PLAYER_ID) { DmScore[killerid]++; if(DmScore[killerid] > DmHiScore) { new dmname[MAX_PLAYER_NAME]; GetPlayerName(killerid, dmname, sizeof(dmname)); DmHiPlayer = killerid; DmHiScore = DmScore[killerid]; format(string, sizeof(string), "DMNEWS: %s Is now in the lead with %d", dmname,DmHiScore); BroadCast(COLOR_WHITE, string); format(string, sizeof(string), " ~g~%d~w~|~g~%d",DmScore[killerid],DmHiScore); } else { format(string, sizeof(string), " ~r~%d~w~|~g~%d",DmScore[killerid],DmHiScore); } GameTextForPlayer(killerid, string, 5000, 6); } } GetWeaponName(reason, deathreason, 20); format(dmessage, sizeof(dmessage), "~r~Vocк estб morto"); if (strlen(deathreason) == 0) { format(deathreason, sizeof(deathreason), "Fists"); } if (reason == 41) { format(deathreason, sizeof(deathreason), "Pepper Spray"); } if (gPlayerCheckpointStatus[playerid] == CHECKPOINT_DROPOFF) { if (gdebug){print("DEBUG test6");} DisablePlayerCheckpoint(playerid); gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; new check; check = gPlayerCheckpointStatus[playerid]; if (gdebug){printf("DEBUG check %d" ,check);} OnPlayerDropCashBox(playerid); } if (gPlayerCheckpointStatus[playerid] == CHECKPOINT_BFDROPOFF) { if (gdebug){print("DEBUG test7");} DisablePlayerCheckpoint(playerid); gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; new check; check = gPlayerCheckpointStatus[playerid]; if (gdebug){printf("DEBUG check %d" ,check);} OnPlayerDropBriefCase(playerid); } if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11) { DisablePlayerCheckpoint(playerid); gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE; LapCount[playerid] = 0; } /* if((PlayerInfo[playerid][pPhousekey]+1 != gLastCar[playerid] && gLastCar[playerid] != 0) || HireCar[playerid] != gLastCar[playerid] && gLastCar[playerid] != 0) { printf("DEBUG PlayerInfo[playerid][pPhousekey](%d) gLastCar[playerid]-1(%d) HireCar[playerid](%d)", PlayerInfo[playerid][pPhousekey],gLastCar[playerid]-1,HireCar[playerid]); UnLockCar(gLastCar[playerid]); gCarLock[gLastCar[playerid]] = 0; gLastDriver[gLastCar[playerid]] = 300; gLastCar[playerid] = 0; } */ new caller = Mobile[playerid]; if(caller != 255) { if(caller < 255) { SendClientMessage(caller, COLOR_GRAD2, " A linha sу foi morto..."); CellTime[caller] = 0; CellTime[playerid] = 0; Mobile[caller] = 255; } Mobile[playerid] = 255; CellTime[playerid] = 0; } ClearCrime(playerid); if (killerid == INVALID_PLAYER_ID) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && gTeam[i] != gTeam[playerid] && CrimInRange(20.0, playerid,i) && GetPlayerState(i) != 2) { killerid = i; format(deathreason, sizeof(deathreason), "Intimidation"); PlayerInfo[playerid][pIntimD]++; } } } if (killerid == INVALID_PLAYER_ID) { if ((gTeam[playerid]) == 0) { return 1; |
public OnPlayerDeath(playerid, killerid, reason)
{
// e so dar um espasso e colocar aqui
if(killerid != 255)
{
if(GetPlayerState(killerid) == 2)
{
new carroDB = GetPlayerVehicleID(killerid);
new nomexd[MAX_PLAYER_NAME];
GetPlayerName(killerid, nomexd, sizeof(nomexd));
if(IsAPlane(carroDB))
{
return 1;
}
format(string, sizeof(string), "AdmCmd: %s [id:%d] Matou %s [Id:%d] com DB, Ele foi kikado.", nomexd,killerid, name, playerid);
SendClientMessageToAll(COLOR_LIGHTRED, string);
Kick(killerid);
return 1;
}
}
//nгo precisa mecher em nada, e se der um erro procure a linha, e mediga qual e.
SendDeathMessage(killerid, playerid, reason);
if (gdebug >=0){printf("OnPlayerDeath Playerid:%d killerid:%d reason:%d", playerid, killerid, reason);}
new name[MAX_PLAYER_NAME];
new string[256];
new dmessage[128];
new deathreason[20];
new playercash;
new victimteam;
new Floatx,Floaty,Floatz;
//new killerteam;
victimteam = (gTeam[playerid]);
//killerteam = (gTeam[killerid]);
gPlayerSpawned[playerid] = 0;
GetPlayerName(playerid, name, sizeof(name));
PlayerInfo[playerid][pLocal] = 255;
GetPlayerPos(playerid, px, py, pz);
if (EventsProxDetectorV(100.0, playerid, 254) || EventsProxDetectorV(100.0, playerid, 255) || EventsProxDetectorV(100.0, playerid, 256))
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && (i != playerid))
{
new tmpcar = GetPlayerVehicleID(i);
if (tmpcar >= 254 && tmpcar <= 256)
{
if (PlayerHaul[tmpcar][pLoad] > 0)
{
PlayerInfo[i][pWA]++;
if(PlayerInfo[i][pWA] >= 20)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pWA] = 0;
SendClientMessage(i, COLOR_YELLOW, "ganhou +1 exp");
}
PlayerHaul[tmpcar][pLoad]--;
GiveMoney(playerid, 5000);
}
}
}
}
SendDeathMessage(killerid, playerid, reason);
}
if(killerid != INVALID_PLAYER_ID)
{
new oldlevel;
new newlevel;
//oldlevel = GetPlayerWantedLevel(killerid);
oldlevel = PlayerInfo[killerid][pWantedlevel];
newlevel = oldlevel + 1;
SetPlayerWantedLevel(killerid, newlevel);
ADBy(playerid, killerid, reason);
Score[killerid]++;
}
if(gPlayerFighter[playerid] == 1)
{
DmScore[playerid]--;
if(killerid != INVALID_PLAYER_ID)
{
DmScore[killerid]++;
if(DmScore[killerid] > DmHiScore)
{
new dmname[MAX_PLAYER_NAME];
GetPlayerName(killerid, dmname, sizeof(dmname));
DmHiPlayer = killerid;
DmHiScore = DmScore[killerid];
format(string, sizeof(string), "DMNEWS: %s Is now in the lead with %d", dmname,DmHiScore);
BroadCast(COLOR_WHITE, string);
format(string, sizeof(string), " ~g~%d~w~|~g~%d",DmScore[killerid],DmHiScore);
}
else
{
format(string, sizeof(string), " ~r~%d~w~|~g~%d",DmScore[killerid],DmHiScore);
}
GameTextForPlayer(killerid, string, 5000, 6);
}
}
GetWeaponName(reason, deathreason, 20);
format(dmessage, sizeof(dmessage), "~r~Vocк estб morto");
if (strlen(deathreason) == 0)
{
format(deathreason, sizeof(deathreason), "Fists");
}
if (reason == 41)
{
format(deathreason, sizeof(deathreason), "Pepper Spray");
}
if (gPlayerCheckpointStatus[playerid] == CHECKPOINT_DROPOFF)
{
if (gdebug){print("DEBUG test6");}
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
new check;
check = gPlayerCheckpointStatus[playerid];
if (gdebug){printf("DEBUG check %d" ,check);}
OnPlayerDropCashBox(playerid);
}
if (gPlayerCheckpointStatus[playerid] == CHECKPOINT_BFDROPOFF)
{
if (gdebug){print("DEBUG test7");}
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
new check;
check = gPlayerCheckpointStatus[playerid];
if (gdebug){printf("DEBUG check %d" ,check);}
OnPlayerDropBriefCase(playerid);
}
if (gPlayerCheckpointStatus[playerid] > 4 && gPlayerCheckpointStatus[playerid] < 11)
{
DisablePlayerCheckpoint(playerid);
gPlayerCheckpointStatus[playerid] = CHECKPOINT_NONE;
LapCount[playerid] = 0;
}
/*
if((PlayerInfo[playerid][pPhousekey]+1 != gLastCar[playerid] && gLastCar[playerid] != 0) || HireCar[playerid] != gLastCar[playerid] && gLastCar[playerid] != 0)
{
printf("DEBUG PlayerInfo[playerid][pPhousekey](%d) gLastCar[playerid]-1(%d) HireCar[playerid](%d)", PlayerInfo[playerid][pPhousekey],gLastCar[playerid]-1,HireCar[playerid]);
UnLockCar(gLastCar[playerid]);
gCarLock[gLastCar[playerid]] = 0;
gLastDriver[gLastCar[playerid]] = 300;
gLastCar[playerid] = 0;
}
*/
new caller = Mobile[playerid];
if(caller != 255)
{
if(caller < 255)
{
SendClientMessage(caller, COLOR_GRAD2, " A linha sу foi morto...");
CellTime[caller] = 0;
CellTime[playerid] = 0;
Mobile[caller] = 255;
}
Mobile[playerid] = 255;
CellTime[playerid] = 0;
}
ClearCrime(playerid);
if (killerid == INVALID_PLAYER_ID)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] != gTeam[playerid] && CrimInRange(20.0, playerid,i) && GetPlayerState(i) != 2)
{
killerid = i;
format(deathreason, sizeof(deathreason), "Intimidation");
PlayerInfo[playerid][pIntimD]++;
}
}
}
if (killerid == INVALID_PLAYER_ID)
{
if ((gTeam[playerid]) == 0)
{
return 1;