SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/06/2012, 01:30 PM   #1
Rg-Gaming.Info
Banned
 
Join Date: Jan 2012
Location: Bulgaria
Posts: 222
Reputation: 8
Default [PROBLEM]OnPlayerDeath

Hello guys i have a little problem here every time i try to implement this function into OnPlayerDeath i get
Code:
invalid subscript (not an array or too many subscripts): "pScore"
expression has no effect
expected token: ";", but found "]"
invalid expression, assumed zero
too many error messages on one line
That is for the line:
Code:
pScore[killerid]++;

pawn Code:
SendDeathMessage(killerid, playerid, reason);
 
    if(killerid != INVALID_PLAYER_ID)
    {
        pScore[killerid]++;
        SetPlayerScore(killerid, pScore[killerid]);
 
        pCash[killerid] += 100;
        GivePlayerMoney(killerid, 100);
    }
 
    pDeaths[playerid]++;
    pCash[playerid] -= 100;
    pScore[playerid]--;
    SetPlayerScore(playerid, pScore[playerid]);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, pCash[playerid]);

Any idea how to fix it ? I took it from the wiki and i am trying to implement it in the BFTDM GM(my gm). And i am using register system from here. I changed all pKills to pScore
Rg-Gaming.Info is offline   Reply With Quote
Old 11/06/2012, 02:03 PM   #2
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 569
Reputation: 21
Default Re: [PROBLEM]OnPlayerDeath

pScore[killerid] = pScore[killerid] + 1; try this
__________________
Code:
• [GameMode]Unfinished roleplay script [Dynamic]
• [GameMode]LostHeaven: Roleplay (SW-RP Edit)
• [FilterScript]Stopwatch Filterscript
• [FilterScript] CreateVehicle Organized IDs
• [Function] GetVehicleTrailerPos
• [Tutorial] MySQL Threading
CoaPsyFactor is offline   Reply With Quote
Old 11/06/2012, 02:14 PM   #3
Rg-Gaming.Info
Banned
 
Join Date: Jan 2012
Location: Bulgaria
Posts: 222
Reputation: 8
Default Re: [PROBLEM]OnPlayerDeath

Quote:
Originally Posted by CoaPsyFactor View Post
pScore[killerid] = pScore[killerid] + 1; try this
Didn't worked i got the same errors.
Rg-Gaming.Info is offline   Reply With Quote
Old 11/06/2012, 02:22 PM   #4
Niko_boy
High-roller
 
Niko_boy's Avatar
 
Join Date: Aug 2010
Location: INDIA !!! :)) Punjab
Posts: 1,078
Reputation: 107
Default Re: [PROBLEM]OnPlayerDeath

do u have this at top < inscript > ?
-> new pScore[MAX_PLAYERS];
if no add it
Niko_boy is offline   Reply With Quote
Old 11/06/2012, 02:28 PM   #5
Rg-Gaming.Info
Banned
 
Join Date: Jan 2012
Location: Bulgaria
Posts: 222
Reputation: 8
Default Re: [PROBLEM]OnPlayerDeath

Quote:
Originally Posted by Niko_boy View Post
do u have this at top < inscript > ?
-> new pScore[MAX_PLAYERS];
if no add it
I said i am using the register system.... and i have pScore in enum
Rg-Gaming.Info is offline   Reply With Quote
Old 11/06/2012, 02:35 PM   #6
CoaPsyFactor
Gangsta
 
Join Date: Jul 2010
Location: Belgrade, Serbia
Posts: 569
Reputation: 21
Default Re: [PROBLEM]OnPlayerDeath

not in enum, but new pScore[MAX_PLAYERS]
__________________
Code:
• [GameMode]Unfinished roleplay script [Dynamic]
• [GameMode]LostHeaven: Roleplay (SW-RP Edit)
• [FilterScript]Stopwatch Filterscript
• [FilterScript] CreateVehicle Organized IDs
• [Function] GetVehicleTrailerPos
• [Tutorial] MySQL Threading
CoaPsyFactor is offline   Reply With Quote
Old 11/06/2012, 03:26 PM   #7
nickdodd25
Huge Clucker
 
nickdodd25's Avatar
 
Join Date: Jan 2012
Location: samp.teamshrimp.com:7777
Posts: 226
Reputation: 20
Default Re: [PROBLEM]OnPlayerDeath

Idk how your saving system/player stats are set up but if you have a enum then you need something like
pawn Code:
PlayerInfo[killerid][pScore]++;
But player info would be changed to what you have.
Show your enum and then the array it goes to.
__________________
Nick

Team Shrimp Minecraft Finest minecraft server around: mc.teamshrimp.com:25765
New stunt server opening soon!! [Stunt][Dm][Race][Gangwar][Sumo/dd]
www.teamshrimp.com
Need Cheap reliable hosting? Visit Relayed Servers Today!!!!
nickdodd25 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerDeath problem. Matz Scripting Help 5 28/01/2012 07:00 PM
Problem with onplayerdeath Face9000 Scripting Help 4 28/01/2012 12:06 AM
Problem With OnPlayerDeath matute Scripting Help 9 27/01/2012 09:45 PM
OnPlayerDeath Problem Nick Deeds Help Archive 3 21/03/2010 10:04 AM
Problem with OnPlayerDeath...Need Help *BueNoOo* Help Archive 3 27/06/2009 08:50 PM


All times are GMT. The time now is 05:56 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.