Results 1 to 1 of 1

Thread: Example use system (return string)

  1. #1
    Sergeant maxdamage99's Avatar
    Join Date
    Aug 2014
    Location
    Russia
    Posts
    458
    Thanks
    79
    Thanked 122 Times in 101 Posts

    Example use system (return string)

    File time.sh in dir libcod.so file, and have permissions 755
    Code:
    PHP Code:
    hook_realtime()
    {
     
    timing=system("./time.sh");
     
    array_time=[];
     
    level.server_data=[];
     
    array_time=exploding_data(timing); /* FUNCTION RETURN array_time[0]="Monday"; array_time[1]="March" etc. */
     
    level.server_data["time"]=array_time;

    TIME.SH FILE:
    Code:
    #!/bin/bash
    echo "`date`";
    Last edited by maxdamage99; 2nd January 2016 at 13:05.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •