Jump to content

[PAWN] Tutorial 3 - Timer


PresidenT AnaS
 Share

Recommended Posts

Hello.This day We have Work about Timer.

//Includes

 

 

 

#include <a_samp>
#include <ocmd>
#include <sscanf2>
#include <a_mysql>

 

 

//enums

 

 

 

enum playerInfo{
eingeloggt,
level,
db_id,
alevel
}

 

 

//Globale Variablen

 

 

 

new dbhandle;
new sInfo[MAX_PLAYERS][playerInfo];
new bInfo[][buildingsEnum] = {
{243.0825,-178.3224,1.5822,285.3642,-41.5576,1001.5156,1,"AMMUN1"},//Ammunation1
{212.1142,-202.1886,1.5781,372.4523,-133.5244,1001.4922,5,"FDPIZA"}//Pizza
};
new cInfo[50][carEnum];
new ahInfo[][autohausEnum] = {
{125.7242,-170.1469,1.2838,177.7335},//id: 0 1. autohaus
{189.8910,-263.3446,1.2829,180.6895}//id: 1 2. autohaus
};
new ahCars[][autohauscarEnum] = {
{560,118.5637,-153.0834,1.2834,186.6475,50000,0},
{411,106.3420,-158.7720,1.7527,257.3197,80000,0},
{400,204.8894,-265.4756,1.2866,354.1406,10000,1}
};
new sekunden_timer;

 

 

 

//Farben
#define COLOR_RED 0xFF0000FF
 
//Dialoge
#define DIALOG_TELEPORT 1
#define DIALOG_REGISTER 2
#define DIALOG_LOGIN 3
#define DIALOG_AUTOHAUS 4
 
//MySQL
#define db_host "127.0.0.1"
#define db_user "samp"
#define db_pass "mysqlpasswort"
#define db_db "samp"
 
//Timer
 

 

sekunden_timer = SetTimer("sekunde",1000,true);
 

{

new query[128];
format(query,sizeof(query),"INSERT INTO autos (besitzer,model,x,y,z,r) VALUES ('%i','%i','%f','%f','%f','%f')",sInfo[playerid][db_id],cInfo[carid][model],cInfo[carid][c_x],cInfo[carid][c_y],cInfo[carid][c_z],cInfo[carid][c_r]);
mysql_function_query(dbhandle,query,true,"carSavedToDB","i",carid);
return 1;
}
}
if(dialogid==DIALOG_TELEPORT)
{
Thanks For your time .Good Bye.

 

Edited by Cdorsu
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.