How can i make an police wanted file?
#5

Quote:
Originally Posted by Phreak
Посмотреть сообщение
PHP код:
new playerName[MAX_PLAYER_NAME];
new 
query[128];
GetPlayerName(playeridplayerNamesizeof playerName);
mysql_format(dbquerysizeof query"INSERT INTO `crimes` (`playername`, `commitedcrime`) VALUES ('%e', '%e')"playerNamecommitedCrime); // commitedCrime would be the variable where you'd store the crime that the player has commited
mysql_tquerry(dbquery); 
And when you wanna show the dialog.

PHP код:
new playerName[MAX_PLAYER_NAME];
new 
query[128];
GetPlayerName(playeridplayerNamesizeof playerName);
mysql_format(dbquerysizeof query"SELECT * FROM `crimes` WHERE `playername` = '%e'"playerName);
mysql_tquery(dbquery"CrimeCallback");
forward CrimeCallback();
public 
CrimeCallback(){
    new 
rows_found cache_num_rows();
    if(
rows_found 0){
        new 
crimesArray[rows_found]; // max number of crimes to be shown in the brackets
        
for(var i=0i<rows_found;i++){
             
cache_get_value_name(i"commitedcrime"crimesArray[i], max_size_of_crime);
        }
        
format(bla bla blacrimesArray[0],crimesArray[1]...);
        
ShowPlayerDialog(bla bla blathe_formatted_string);
        
        
    } else {
        
ShowPlayerDialog(bla bla bla"No crimes commited");
    }

And if this doesn't work straight away you may have to save the cache and activate it first.
That doesnt work, because cache_get_value_name is not defined and rows_found is an error
Reply


Messages In This Thread
How can i make an police wanted file? - by ImTobi - 25.04.2018, 18:16
Re: How can i make an police wanted file? - by jasperschellekens - 25.04.2018, 18:20
Re: How can i make an police wanted file? - by ImTobi - 25.04.2018, 18:37
Re: How can i make an police wanted file? - by Phreak - 25.04.2018, 19:12
Re: How can i make an police wanted file? - by ImTobi - 25.04.2018, 19:44
Re: How can i make an police wanted file? - by Phreak - 25.04.2018, 19:56
Re: How can i make an police wanted file? - by jasperschellekens - 25.04.2018, 20:43

Forum Jump:


Users browsing this thread: 1 Guest(s)