Help! Killing Score and Money! -
martini002 - 27.03.2011
Dear All
Surely some people also have
these problems on their servers
the question is that the server does not recognize
The score of each player, always kept at 0
or the best at -1 or -2
strange? I think there is something that is not functioning
quite right, help me i will appreciate it
also:
the amount of money that players earn when
kill another person of the opposite side
I'm starting in Pawno and then annex them
I think the code is the one relationship
with the killing score and money for that
Код:
new kstring[128]; //killer message
GetPlayerName(playerid, pname, sizeof(pname));
format(kstring, sizeof(kstring), "~b~Haha Ya 0wned %s",pname);
GameTextForPlayer(killerid, kstring, 4000, 3);
new kname[MAX_PLAYER_NAME]; //killername
GetPlayerName(killerid, kname, sizeof(kname));
format(pstring, sizeof(pstring), "~r~:( you got 0wned by %s",kname);
GameTextForPlayer(playerid, pstring, 4000, 3);
new kscore=GetPlayerScore(killerid);
SetPlayerScore(killerid,kscore++);
PlayerInfo[playerid][Deaths]++;
PlayerInfo[killerid][Kills]++;
new moneytemp;
moneytemp = GetPlayerMoney(playerid)/8;
if(moneytemp<=5000) {
GivePlayerMoney(killerid,moneytemp);
GivePlayerMoney(playerid,-moneytemp);
}
else if(moneytemp>5000) {
GivePlayerMoney(killerid,5000);
GivePlayerMoney(playerid,-5000);
}
SendClientMessageToAll(COLOR_RED, string);
DropWeapons(playerid);
IsSpawned[playerid] = 0;
cuffed[playerid] = 0;
Tazed[playerid] = 0;
hastazer[playerid] = 0;
LawEnforcementRadio[playerid] = 0;
HasLawEnforcementRadio[playerid] = 0;
ReqBk[playerid] = 0;
ReqBkRecent[playerid] = 0;
ReportedRecent[playerid] = 0;
VisitReq[playerid] = 0;
EscapedConvict[playerid] = 0;
VisitReqExpires[playerid] = 0;
StoleCopCarRecent[playerid] = 0;
triedtoescaperecent[playerid] = 0;
JailTime[playerid] = 0;
JailTimeServed[playerid] = 0;
copshavevc[playerid] = 0;
commitedcrimerecently[playerid] = 0;
wantsheal[playerid] = 0;
wantscure[playerid] = 0;
InfectedPlyRecent[playerid] = 0;
wantsweed[playerid] = 0;
playeronweed[playerid] = 0;
playertookweed[playerid] = 0;
HasWeedBag[playerid] = 0;
CuffedTime[playerid] = 0;
cannotescapejail[playerid] = 0;
RobbedPlyRecent[playerid] = 0;
beenrobbedrecently[playerid] = 0;
HasWallet[playerid] = 0;
OldCash[playerid] = 0;
Chlamydia[playerid] = 0;
instunt[playerid] = 0;
return 1;
}
Re: Help! Killing Score and Money! -
grand.Theft.Otto - 27.03.2011
pawn Код:
// under OnPlayerDeath
SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
Respuesta: Help! Killing Score and Money! -
martini002 - 27.03.2011
Thanks for answer
Just under OnPlayerDeath it is
where can i put your two lines?
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new msg[128],reasonMsg[32], pname[MAX_PLAYER_NAME], string[128], deathreason[20];
SendDeathMessage(killerid,playerid,reason);
GameTextForPlayer(playerid,"~r~~h~OWNED",10000,1);
GetPlayerName(playerid, pname, sizeof(pname));
GetWeaponName(reason, deathreason, 20);
new pstring[128]; //player message
new killer[MAX_PLAYER_NAME];
GetPlayerName(killerid, killer, sizeof(killer));
if(InDM[playerid]==1) InDM[playerid]=0;
SetPlayerWorldBounds(playerid,20000.0000,-20000.0000,20000.0000,-20000.0000); //Reset world to player
Re: Help! Killing Score and Money! -
grand.Theft.Otto - 27.03.2011
Just put it under GetPlayerName(killerid, killer, sizeof(killer));
Respuesta: Help! Killing Score and Money! -
martini002 - 27.03.2011
Nice!! Work,
but for the money? i want get 100.000
if i kill him
and -100.000 for the other guy
thanks for your help dude
Re: Help! Killing Score and Money! -
grand.Theft.Otto - 27.03.2011
Under GetPlayerName(killerid, killer, sizeof(killer));
pawn Код:
GivePlayerMoney(killerid,100000);
GivePlayerMoney(playerid,-100000);
No problem
Respuesta: Help! Killing Score and Money! -
martini002 - 27.03.2011
hahahaha yes, i just put it
thanks again for your help, have good night
Код:
GivePlayerMoney(killerid, GetPlayerScore(killerid) + 250000);
GivePlayerMoney(playerid, GetPlayerScore(playerid) - 150000);
Re: Help! Killing Score and Money! -
grand.Theft.Otto - 27.03.2011
No problem! You too !