SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 15/02/2018, 06:51 PM   #1
Djumza
Big Clucker
 
Join Date: Apr 2012
Posts: 63
Reputation: 3
Unhappy Expression has no effect

Hey,
so let's say i want to add +1 kill to killerid stats.
pawn Code:
PlayerInfo[killerid][pKills]++;
what i have to do if i want to add more then +1 ?
pawn Code:
PlayerInfo[killerid][pKills]+3;
it gives me warning " warning 215: expression has no effect "

Thanks for help.
Djumza is offline   Reply With Quote
Old 15/02/2018, 06:53 PM   #2
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,139
Reputation: 445
Default Re: Expression has no effect

Adding 3 like that won't do anything as a single statement, you can do:
PHP Code:
PlayerInfo[killerid][pKills] += 3
This adds 3 to the current value. You can also do some other operations this way.
Abagail is offline   Reply With Quote
Old 15/02/2018, 07:00 PM   #3
Djumza
Big Clucker
 
Join Date: Apr 2012
Posts: 63
Reputation: 3
Default Re: Expression has no effect

You are the king my friend ! Thanks a lot !
Djumza 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
expression has no effect Bondz Scripting Help 2 15/10/2016 08:34 AM
Expression Has no Effect Genmetal Scripting Help 5 02/05/2015 12:22 PM
error 029: invalid expression, assumed zero & warning 215: expression has no effect tboysamp Scripting Help 3 23/03/2015 04:49 PM
expression has no effect Salim_Karaja Scripting Help 2 24/02/2013 09:07 PM
expression has no effect rati555 Scripting Help 2 21/01/2012 05:43 PM


All times are GMT. The time now is 07:27 AM.


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