Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int numero;
- getchar();
- case 13: // Guarda Real 1
- {
- stream = fopen("Guarda_1.csv", "r"); // LE O ARQUIVO
- while ((fscanf(stream, "%[^\n]", line)) != EOF)
- {
- fgetc(stream);
- int Entregue1,Entregue2,Recebe, Recebe2, Recebe3;
- sscanf(line, "%d,%d,%d,%d,%d", &Entregue1, &Entregue2,&Recebe, &Recebe2, &Recebe3);
- if ((cSlot1 == Entregue1) && (cSlot2 == Entregue2)) //Condicional se possui osi tens
- {
- srand(time(NULL)); // "desbuga" o rand
- numero = rand() % 3; // gera o aleatório
- printf("%dn", numero);
- PInt(addr_bclient + 0x15C6A94) = 0; // Zera o slot 1
- PInt(addr_bclient + 0x15C6A9C) = 0; // Zera o slot 2
- if(numero==0) // Se for 0
- {
- PInt(addr_bclient + 0x15C6A94) = Recebe; // Entrega o item 1
- SendClientMessage(clientid, "Trocado - 0"); // Trocado
- SendStats(clientid);
- fclose(stream);
- DC(clientid);
- }
- if(numero==1) //Se for 1
- {
- PInt(addr_bclient + 0x15C6A94) = Recebe2; //Entrega o item 2
- SendClientMessage(clientid, "Trocado - 1"); // Trocado
- SendStats(clientid);
- fclose(stream);
- DC(clientid);
- }
- if(numero==2) //Se for 2
- {
- PInt(addr_bclient + 0x15C6A94) = Recebe3; // Entrega o item 3
- SendClientMessage(clientid, "Trocado - 2"); // Trocado
- SendStats(clientid);
- DC(clientid);
- fclose(stream);
- }
- }
- else //Se não possuir os itens
- {
- SendChat(npcid, "Trouxe os itens?"); // Mensagem
- }
- }
- fclose(stream);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement