[Ajuda] quero por id de conta no meu gamemode em DOF2
#1

quero criar um id de conta no meu gamemode pelo DOF2 meu amigo falo q tem como

tipo quando o player loga cada conta criada 1 um ID variado tipo 1500 1432 Entre outros entende ?

Tem modos diferentes nгo sу em mysql mas tanbem como DOF2...
Reply
#2

Explique melhor isso aн.
Reply
#3

ID de contas Registradas?
Ou Tipo o na conta tipo conta 0,1,2,3,4 assim por diante
Reply
#4

Se vocк quiser um contador que comeзa do 1, use: http://forum.sa-mp.com/showpost.php?...2&postcount=28

Caso queira que comece do 1000:
PHP код:
stock CreateUniqueID()
{
    
#define UID_File "UniqueID_Count.ini"
    
if(!DOF2_FileExists(UID_File))
    {
        
DOF2_CreateFile(UID_File);
        
DOF2_SetInt(UID_File"Count"1000);
        
DOF2_SaveFile();
    }
    new 
count DOF2_GetInt(UID_File"Count") + 1;
    
DOF2_SetInt(UID_File"Count"count);
    
DOF2_SaveFile();
    return 
count;

A aleatoriedade do ID vai ser dada pela quantidade de jogadores registrados.
Reply
#5

Nгo Funciou
Reply
#6

https://sampforum.blast.hk/showthread.php?tid=643060
Reply
#7

Quote:
Originally Posted by RodrigoMSR
Посмотреть сообщение
Se vocк quiser um contador que comeзa do 1, use: http://forum.sa-mp.com/showpost.php?...2&postcount=28

Caso queira que comece do 1000:
PHP код:
stock CreateUniqueID()
{
    
#define UID_File "UniqueID_Count.ini"
    
if(!DOF2_FileExists(UID_File))
    {
        
DOF2_CreateFile(UID_File);
        
DOF2_SetInt(UID_File"Count"1000);
        
DOF2_SaveFile();
    }
    new 
count DOF2_GetInt(UID_File"Count") + 1;
    
DOF2_SetInt(UID_File"Count"count);
    
DOF2_SaveFile();
    return 
count;

A aleatoriedade do ID vai ser dada pela quantidade de jogadores registrados.
Vocк precisa pфr para salvar o ID nй.
Reply
#8

Quote:
Originally Posted by wainner
Посмотреть сообщение
Nгo Funciou
Mande o que vocк fez.
Reply
#9

PHP код:
#include "DOF2"
new GetarIdServer;
enum jogador {
ID
}
new 
Player[MAX_PLAYERS][jogador];
QuandoPlayerClicarEmRegistrar()
{
   
GetarIdServer ++;
   
Player[playerid][ID] = GetarIdServer;
   new 
string[20];
   
format(stringsizeof(string), "LUGAR/SCRIPTFILES""Nome");
   
DOF2::CreateFile(string);
   
DOF2::SetInt(string"IdsCriados"GetarIdServer);
   
DOF2::SaveFile();
}
OnGameModeInit()
{
    new 
string[20];
    
format(stringsizeof(string), "LUGAR/SCRIPTFILES""Nome");
    if(
DOF2_FileExists(string))
    {
    
GetarIdServer DOF2::GetInt(string"IdsCriados");
    }

Ira comeзar com 1,2,3,4,5,6...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)