Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: nabilfx on November 17, 2015, 02:17:10 PM

Title: Help script addScore
Post by: nabilfx on November 17, 2015, 02:17:10 PM
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.

Quote
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.
Title: Re: Help script addScore
Post by: dudebxl on January 17, 2016, 06:54:57 PM
Did you ever solve the problem? I am trying to post to php and having problems with WWW post mobile action.. Any feedback or recommendations?