WantedLevel

Started by [VSS]Shawn, Jun 26, 2015, 03:41 PM

Previous topic - Next topic

[VSS]Shawn

Hello Friends i am making Roleplay server but i am facing problem I have WantedLevel Row in Table of Accounts i add this onPickupPickup
pinfo[ player.ID ].WantedLevel ++;
QuerySQL( db, "UPDATE Accounts SET WantedLevel= '" + pinfo[ player.ID ].WantedLevel + "' WHERE Name='" + player.Name.tolower() + "'" );
SetWantedLevel(player,GetWantedLevel(player)+10);
But when i rob store it give me robskills but not give me wantedlevel
What is Problem?

Thijn

The correct syntax is player.WantedLevel = int

[VSS]Shawn

I know Thijn but i made Row for it in Accounts and this is My GetWantedLevel and SetWantedLevel Function


function SetWantedLevel( player, amount )
{
      QuerySQL(db, "UPDATE WantedLevel SET WantedLevel='" +  amount.tointeger() + "' WHERE Name='" + player.Name + "'");   
}


function GetWantedLevel( player )
{
   local want =  GetSQLColumnData( QuerySQL( db, "SELECT WantedLevel FROM Accounts WHERE Name='" + player.Name+"'" ), 0 );
   if ( want ) return want.tointeger();
   else return 0;
}

Stormeus

So is the problem that you don't get wanted stars or that the wanted level doesn't save?

[VSS]Shawn

No i am not talking about wanted stars i am saying as u my pickuppickup there is Update Accounts and setwantedlevel + 1 but db show there is 0 wanted level

EK.IceFlake

Quote from: [VSS]Shawn on Jun 26, 2015, 04:43 PMI know Thijn but i made Row for it in Accounts and this is My GetWantedLevel and SetWantedLevel Function


function SetWantedLevel( player, amount )
{
      QuerySQL(db, "UPDATE WantedLevel SET WantedLevel='" +  amount.tointeger() + "' WHERE Name='" + player.Name + "'");   
}


function GetWantedLevel( player )
{
   local want =  GetSQLColumnData( QuerySQL( db, "SELECT WantedLevel FROM Accounts WHERE Name='" + player.Name+"'" ), 0 );
   if ( want ) return want.tointeger();
   else return 0;
}
1. Why do you convert it to an integer when it will be converted back to a string anyways?
2. Which is the query you make table Accounts

[VSS]Shawn


[VSS]Shawn

Thanks I Found Problem I Set Wanted Level in Wnated Level Table
Problem Solved