tointeger

Started by [VSS]Shawn, Jul 11, 2015, 05:18 PM

Previous topic - Next topic

[VSS]Shawn

hello i am facing problem i was converting script it works correctly then i was adding some extra function and then i dont know what is error this always come on playerspawn

the index tointeger does not exist

Mashreq

Why dont you post the screenshot and the code? Please show us your onPlayerSpawn event.

.

local i_get_this_much_pussay = null;
print( i_get_this_much_pussay.tointeger() );

Output:
0, you don't get any pussay :P
Coz checking for null values is so lame this days. Better let it fail and wonder about it ;D
.

[VSS]Shawn

function onPlayerSpawn( player )
{
if ( GetPass( player ) )
{
if ( GetLoggedStatus(player).tolower()=="true")
{
Setwantedlevel(player,Getwantedlevel(player));
pinfo[player.ID].TTime=GetTime();
pinfo[player.ID].C4=0;
SetCash( player, GetCash( player ).tointeger());
messagez.push({
            name = player.Name,
team = player.Team,
       skin = player.Skin,
            type = 3
            });
if(messagez.len() > 20) messagez.remove(0);
if(Getjailed(player))
{
player.Pos=Vector( 388.680, -509.527, 8.415 );
pinfo[player.ID].jailed=1;
pinfo[player.ID].Jailtime=GetTime();
Setjailed(player,1);
player.IsFrozen = true;
local wanted = Getwantedlevel(player),c=0;
wanted=wanted*20;
if(wanted>600) wanted=600;
ClientMessageToAll( player.Name+" has been jailed!",159,204,280);
Announce( "You've been sent to jail for "+wanted.tointeger()+" seconds!", player);
                               
wanted=wanted*1000;
foreach(i,val in jail)
{
if(jail[i]==player.ID)
c++;
}
if(c==0)jail.push(player.ID);

NewTimer( "Unjail", wanted.tointeger() , 1, player.ID,wanted);
}
else if (pinfo[player.ID].team<99)
{
local plr=FindPlayer(pinfo[player.ID].team);
if(plr)
{
if(plr.IsSpawned)
{
ClientMessage ("You've spawned next to your team-mate "+plr.Name+".",player,255,255,0);
player.Pos=plr.Pos;
}
else ClientMessage ("Your team-mate "+plr.Name+" hasn't spawned!",player,255,255,0);
}
}
if(player.Skin==1)
{
if(Getwantedlevel(player)==0)
{
ClientMessage ( "You are now a Cop, use /c wanted to see wanted criminals and than arrest or kill them", player ,255,255,0);
ClientMessage ( "you can also use /c sus [Nick/ID] [Reason] to suspect someone, for more help use !jobhelp.", player ,255,255,0);
SetJob(player,2);
player.SetWeapon( 1, 259 );
player.Score = Getcopskills(player);
ClientMessage ( "Your police rank is: "+GetCoplevel(player)+".", player ,255,255,0);
               
}
else
{
ClientMessage ( "You need to clear your wanted level to be a cop, use /c sur.", player,255,255,0 );
Announce("~b~ Clear your wanted level to be a cop", player);
player.Health=0;
}
}
                       else if(player.Skin==102||player.Skin==2)
{
if(Getwantedlevel(player)==0)
{
ClientMessage ( "You are now a Cop, use /c wanted to see wanted criminals and than arrest or kill them", player ,255,255,0);
ClientMessage ( "you can also use /c sus [Nick/ID] [Reason] to suspect someone, for more help use !jobhelp.", player ,255,255,0);
SetJob(player,2);
player.SetWeapon( 1, 259 );
player.Score = Getcopskills(player);
ClientMessage ( "Your police rank is: "+GetCoplevel(player)+".", player ,255,255,0);
             
}
else
{
ClientMessage ( "You need to clear your wanted level to be a cop, use /c sur.", player,255,255,0 );
Announce("~b~ Clear your wanted level to be a cop", player);
player.Health=0;
}
}

else if(player.Skin==3)
{
if(Getwantedlevel(player)==0)
{
ClientMessage ( "You are now an FBI Agent, use /c wanted to see wanted criminals and than arrest or kill them", player ,255,255,0);
ClientMessage ( "you can also use /c sus [Nick/ID] [Reason] to suspect someone, for more help use /c jobhelp.", player ,255,255,0);
SetJob(player,2);
player.SetWeapon( 1, 259 );
player.Score = Getcopskills(player);
ClientMessage ( "Your police rank is: "+GetCoplevel(player)+".", player ,255,255,0);               
}
else
{
ClientMessage ( "You need to clear your wanted level to be an FBI Agent, use /c sur.", player ,255,255,0);
Announce("~b~ Clear your wanted level to be an fbi agent", player);
player.Health=0;
}
}
                        else if(player.Skin==27)
{

ClientMessage ( "You Need To Dilver The Pizz`s By Knowing That Who Want It Following Commands Are Here", player,255,255,0 );
ClientMessage ( "/c takepizza,dilverpizza,/c pizzalist,/c buypizza,eatpizza(civilion),givepizzaorder(Civilion).", player ,255,255,0);
SetJob(player,44);
player.SetWeapon( 1, 259 );
}
                                else if(player.Skin==55)
{

ClientMessage ( "You Are From The Terrorist/Dmear Team You Can Do These Things:", player,255,255,0 );
ClientMessage ( "/c buybomb,/c plantbomb or kill dmears.", player ,255,255,0);
SetJob(player,7);
player.SetWeapon( 1, 259 );
}
else if(player.Skin==4)
{
if(Getwantedlevel(player)==0)
{
ClientMessage ( "You are now an Army Soldier, use /c wanted to see wanted criminals and than arrest or kill them", player ,255,255,0);
ClientMessage ( "you can also use /c sus [Nick/ID] [Reason] to suspect someone, for more help use /c jobhelp.", player ,255,255,0 );
SetJob(player,2);
player.SetWeapon( 1, 259 );
player.Score = Getcopskills(player);
ClientMessage ( "Your police rank is: "+GetCoplevel(player)+".", player ,255,255,0);
}
else
{
ClientMessage ( "You need to clear your wanted level to be an Army soldier, use /c sur.", player ,255,255,0);
Announce("~b~ Clear your wanted level to be an army soldier", player);
player.Health=0;
}
}
else if(player.Skin==74)
{

ClientMessage ( "You are now a Taxi driver, if anyone asks for medical assistance , if anyone asks for a taxi you will be notified", player,255,255,0 );
ClientMessage ( "than you need to go near to that player and blow your horn, after he/she is sitting in your taxi you need to type !meteron otherwise you wont be paid.", player ,255,255,0);
SetJob(player,4);
                                player.SetWeapon( 1, 259 );
player.Score = Getcopskills(player);
player.SetWeapon( 1, 1 );
}
else if(player.Skin==11)
{
               player.SetWeapon( 1, 259 );
        SetJob(player,1);
ClientMessage ( "Your job is now Kidnapper, get close to a player to kidnap him/her or enter a car as passenger to kidnap the driver using /c kidnap <id>.",player,255,255,0);
ClientMessage ( " but make sure there are no cops in your area using /c areacop.",player,255,255,0);
                                        SetJob2(player,22);
}
                     
                        else if(player.Skin==23)
{
player.SetWeapon( 1, 259 );
        SetJob(player,1);
ClientMessage ( "Your job is now Kidnapper, get close to a player to kidnap him/her or enter a car as passenger to kidnap the driver using /c kidnap <id>.",player,255,255,0);
ClientMessage ( " but make sure there are no cops in your area using /c areacop.",player,255,255,0);
                                        SetJob2(player,22);
}
                       else if(player.Skin==15)
{
player.SetWeapon( 1, 259 );
        SetJob(player,3);
ClientMessage ( "You are now a Drug Dealer, use /c offerdrugs to offer drugs to someone, by typing /c areacop else you will be caught by them.",player,255,255,0);
ClientMessage ( "but make sure there are no cops in your area using /c areacop.",player,255,255,0);
                                        SetJob2(player,22);
}
else if(player.Skin==5)
{
player.SetWeapon( 1, 259 );
ClientMessage ( "You are now a Medical assistant, if anyone asks for medical assistance , you have to go near him/her and heal him/her using /c heal <nick/id>.", player ,255,255,0);
ClientMessage ( "you can tell others to use '!medical' command to ask for medical assistance. ", player,255,255,0 );
SetJob(player,6);
player.Score = Getcopskills(player);
player.SetWeapon( 1, 1 );
}
else if(player.Skin==69)
{
local q = QuerySQL( db, "SELECT Name FROM Government");
if ( GetSQLColumnData( q, 0 ) == player.Name )
{
ClientMessage( "Welcome, Mr. President.",player,255,255,0);
}
else
{
ClientMessage( "You're not the President, please choose a different skin.", player,255,255,0);
            player.Health=0;
            }
            }

            if(GetJob(player) != 2 )
            {
            player.Score = Getrobskills(player);
            player.SetWeapon(0,0);
            }
pinfo[player.ID].pteam=player.Team;
if(Getwantedlevel(player)>0 && Getwantedlevel(player) <5 ) player.Team=1;                                                                 
Markercolor(player);
              NewTimer("create",3000,1,player.ID);
}

 
else
{
ClientMessageToAll( "Auto-Freeze: [ "+player.Name+" ]. Reason: [ Failed to login ]",255,255,0);
ClientMessage ( "Login using /c login <password> ", player ,255,255,0);
player.IsFrozen = true;
Announce( "~y~ /c login", player );
binfo[player.ID].logtry++;
if(binfo[player.ID].logtry>4) Kick( player, "Server" , "Login timed-out" )
}
}
else
{
ClientMessageToAll( "Auto-Kill: ["+player.Name+"]. Reason: [Nick Not Registered]."255,255,0);
ClientMessage ( "Error - your nick is not registered, please use /c register <password> to register your nick", player 159,204,280);
player.Health = 0;
Announce( "~y~ /c register", player );
binfo[player.ID].regtry++;
if(binfo[player.ID].regtry>4) Kick( player, "Server" , "Registration timed-out" )
}


}

Now Dont Say Its big

DizzasTeR

I just want to take 10 players to your server, and then tell them to spawn all together and enjoy the show. You are using leaked version of VCCNR no? Goddamn you people.

[VSS]Shawn

So What?
I Just Want Help

[VSS]Shawn


MatheuS

if( !sucess ) tryAgain();
Thanks to the VCMP community. It was the happiest period of my life.

[VSS]Shawn