Im using this script with iphone, but sometimes it work and sometimes does not work.
The script is for add int score to my database in mysql. What could be the problem?
I put the Int value result of the game, in this way.
the score_GLOBAL is a float result then i convert into a Int, and insert in the java script, here the script.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class AddScore : MonoBehaviour {
void Start(){
AddPScore (0);
}
void AddPScore(int storeResult){
WWWForm form = new WWWForm ();
form.AddField ("user", LoginSystem.userName);
form.AddField ("score", storeResult);
WWW w = new WWW ("http://nfx.comuv.com/AddScore.php",form);
StartCoroutine (receive (w));
Debug.Log("funcionou");
}
IEnumerator receive(WWW w){
yield return w;
if (w.error == null) {
}
}
}
I need to work everytime, not sometimes.