Post: Quick GSC Modding Question
03-12-2013, 01:11 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So I'm creating my first GSC script and I have a question. I have coded HTML, JavaScript and Lua but I am new to the C++ field.

I want to define a value as lets say

self.emp = 1;

But do you have to create that value first?

Here is the script I'm working on.

    
checkEMP()
{
if (self.emp == 0) then
{
self iPrintlnBold("^3EMP Spam Disabled");
self.emp = 1;
}
elseif (self.emp == 1) then
{
self iPrintlnBold("^3EMP Spam Enabled");
self.emp = 0;
EMPSPAM()
}
}

EMPSPAM()
{
if(self.emp == 0) then
{
self maps\mp\killstreaks\_killstreaks::giveKillstreak( "emp", false );
self maps\mp\killstreaks\_killstreaks::killstreakUsePressed();
wait 1.5;
EMPSPAM()
}
else
{
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
03-13-2013, 05:38 AM #2
HanleyzHD♚
Are you high?
Go to this site to learn alot about C++ You must login or register to view this content.

The following user thanked HanleyzHD♚ for this useful post:

03-16-2013, 12:42 AM #3
would I put this in onPlayerConnect to create the self value?

self setDvar("emp","0");
03-16-2013, 12:57 AM #4
No that's just completely wrong. There is no such dvar as emp. And you can't create any.
03-16-2013, 01:23 AM #5
Ok i'm just confused. I have used JavaScript but I have never learned how to create a self value...

---------- Post added at 01:23 AM ---------- Previous post was at 01:22 AM ----------

Originally posted by DidUknowiPwn View Post
No that's just completely wrong. There is no such dvar as emp. And you can't create any.


forgot to quote :/
03-16-2013, 02:08 AM #6
Put somewhere like onconnect self.emp = 0; and that will "register" a child1 variable (I think it's 1, maybe it's 0 who cares.).

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo