Kills ++;
#1

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

Reply
#2

Works fine for me,, try using this instead of TalibanKills ++; and RebelKills ++ :
pawn Код:
TalibanKills += 1;
RebelKills += 1;
Reply
#3

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();
pawn Код:
public 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...
Reply
#4

Then there's a problem in your code somewhere,, check if there are unmatching closing or opening brackets { & } in your script.
Reply
#5

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
Reply
#6

Код:
TalibanKills++;
Rebelkills++;
Theres no space in between the variable and the operator if you want to use the postfix increment operator.
Reply
#7

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
Reply
#8

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;
}
Reply
#9

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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)