Kills ++; - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Kills ++; (
/showthread.php?tid=156164)
Kills ++; -
ToPhrESH - 21.06.2010
pawn Код:
new TalibanKills;
new RebelKills;
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
if(GetPlayerTeam(killerid) == 1)
{
RebelKills ++;
}
else if (GetPlayerTeam(killerid) == 1)
{
TalibanKills ++;
}
}
if (GetPlayerTeam(killerid) == GetPlayerTeam(playerid))
{
SendClientMessage(playerid, 0x008000FF, "Do not spawnkill! You have been punished");
GivePlayerMoney(killerid,-1000);
SetPlayerHealth(killerid, 0.0);
SetPlayerScore(killerid, GetPlayerScore(playerid) -1);
}
else
{
GivePlayerMoney(killerid, 1500);
SendClientMessage(killerid, 0x008000FF, "You killed an enemy! You earn +2 score and some ammo!");
SetPlayerScore(killerid, GetPlayerScore(playerid) +2);
}
return 1;
}
(13
: warning 215: expression has no effect
(13
: error 017: undefined symbol "RebelKills"
error 017: undefined symbol "TalibanKills"
/
and same with taliban any help
Re: Kills ++; -
Virtual1ty - 21.06.2010
Works fine for me,, try using this instead of TalibanKills ++; and RebelKills ++ :
pawn Код:
TalibanKills += 1;
RebelKills += 1;
Re: Kills ++; -
ToPhrESH - 21.06.2010
Quote:
Originally Posted by Virtual1ty
Works fine for me,, try using this instead of TalibanKills ++; and RebelKills ++ :
pawn Код:
TalibanKills += 1; RebelKills += 1;
|
ok thanks
I also
pawn Код:
forward UpdateTextDraw();
It said error it needs to be forwarded when i already had it forwarded
EDIT: I ALSO DID WHAT YOU TOLD ME BUT IT STILL DOESNT KNOW WHAT TallibanKills and Rebel Kills are...
Re: Kills ++; -
Virtual1ty - 21.06.2010
Then there's a problem in your code somewhere,, check if there are unmatching closing or opening brackets { & } in your script.
Re: Kills ++; -
ToPhrESH - 21.06.2010
Quote:
Originally Posted by Virtual1ty
Then there's a problem in your code somewhere,, check if there are unmatching closing or opening brackets { & } in your script.
|
I just deleted the forward stuff. But the kills still arnt being read. I rechecked everything but no open or loose brackets
Re: Kills ++; -
iLinx - 21.06.2010
Код:
TalibanKills++;
Rebelkills++;
Theres no space in between the variable and the operator if you want to use the postfix increment operator.
Re: Kills ++; -
ToPhrESH - 21.06.2010
Quote:
Originally Posted by iLinx
Код:
TalibanKills++;
Rebelkills++;
Theres no space in between the variable and the operator if you want to use the postfix increment operator.
|
still errors
Re: Kills ++; -
NewTorran - 21.06.2010
Quote:
Originally Posted by ToPhrESH
Quote:
Originally Posted by iLinx
Код:
TalibanKills++;
Rebelkills++;
Theres no space in between the variable and the operator if you want to use the postfix increment operator.
|
still errors
|
By the looks of things your editing my TDM? Anyway..
(By the textdraw thing & the kills ++)
Anyway try this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
if(GetPlayerTeam(killerid) == 1)
{
RebelKills ++;
}
else if (GetPlayerTeam(killerid) == 2)
{
TalibanKills ++;
}
if (GetPlayerTeam(killerid) == GetPlayerTeam(playerid))
{
SendClientMessage(playerid, 0x008000FF, "Do not spawnkill! You have been punished");
GivePlayerMoney(killerid,-1000);
SetPlayerHealth(killerid, 0.0);
SetPlayerScore(killerid, GetPlayerScore(playerid) -1);
}
else
{
GivePlayerMoney(killerid, 1500);
SendClientMessage(killerid, 0x008000FF, "You killed an enemy! You earn +2 score and some ammo!");
SetPlayerScore(killerid, GetPlayerScore(playerid) +2);
}
}
return 1;
}
Re: Kills ++; -
ToPhrESH - 21.06.2010
Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by ToPhrESH
Quote:
Originally Posted by iLinx
Код:
TalibanKills++;
Rebelkills++;
Theres no space in between the variable and the operator if you want to use the postfix increment operator.
|
still errors
|
By the looks of things your editing my TDM? Anyway..
(By the textdraw thing & the kills ++)
Anyway try this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { if(IsPlayerConnected(killerid)) { if(GetPlayerTeam(killerid) == 1) { RebelKills ++; } else if (GetPlayerTeam(killerid) == 2) { TalibanKills ++; } if (GetPlayerTeam(killerid) == GetPlayerTeam(playerid)) { SendClientMessage(playerid, 0x008000FF, "Do not spawnkill! You have been punished"); GivePlayerMoney(killerid,-1000); SetPlayerHealth(killerid, 0.0); SetPlayerScore(killerid, GetPlayerScore(playerid) -1); } else { GivePlayerMoney(killerid, 1500); SendClientMessage(killerid, 0x008000FF, "You killed an enemy! You earn +2 score and some ammo!"); SetPlayerScore(killerid, GetPlayerScore(playerid) +2); } } return 1; }
|
Im not copying yours a friend of mine asked me if i could help him figure this out. Hecouldnt figure it out so he sent me it. Sorry if he is ill tell him to stop..... Also the thing you gave me was the same thing i had scripted
Re: Kills ++; -
NewTorran - 21.06.2010
Quote:
Originally Posted by ToPhrESH
Quote:
Originally Posted by Joe Torran C
Quote:
Originally Posted by ToPhrESH
Quote:
Originally Posted by iLinx
Код:
TalibanKills++;
Rebelkills++;
Theres no space in between the variable and the operator if you want to use the postfix increment operator.
|
still errors
|
By the looks of things your editing my TDM? Anyway..
(By the textdraw thing & the kills ++)
Anyway try this:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) { if(IsPlayerConnected(killerid)) { if(GetPlayerTeam(killerid) == 1) { RebelKills ++; } else if (GetPlayerTeam(killerid) == 2) { TalibanKills ++; } if (GetPlayerTeam(killerid) == GetPlayerTeam(playerid)) { SendClientMessage(playerid, 0x008000FF, "Do not spawnkill! You have been punished"); GivePlayerMoney(killerid,-1000); SetPlayerHealth(killerid, 0.0); SetPlayerScore(killerid, GetPlayerScore(playerid) -1); } else { GivePlayerMoney(killerid, 1500); SendClientMessage(killerid, 0x008000FF, "You killed an enemy! You earn +2 score and some ammo!"); SetPlayerScore(killerid, GetPlayerScore(playerid) +2); } } return 1; }
|
Im not copying yours a friend of mine asked me if i could help him figure this out. Hecouldnt figure it out so he sent me it. Sorry if he is ill tell him to stop..... Also the thing you gave me was the same thing i had scripted
|
No hes not copying, I released it, Hes fine to edit it.
And i moved a bracket on the code