Help. :|
#8

Anyway, now I started from 0 with Pickups:

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <YSI\y_ini>

#define PATH "/Pickups/%d.ini"

enum pInfo
{
    Float:pX,
    Float:pY,
    Float:pZ,
    pID,
}
new Pick[MAX_PLAYERS][pInfo];
new pickups;

public OnPlayerConnect(playerid)
{
   INI_ParseFile(PickPath(pickups), "LoadPickup_%s", .bExtra = true, .extra = playerid);
   return 1;
}
CMD:createpick(playerid, params[])
{
    new Pickup, string[128], Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if(sscanf(params,"i", Pickup)) return SendClientMessage(playerid, -1, "{FFCC33}USAGE: {15FF00}/CreatePick [Pick-up ID]");
    format(string, sizeof(string), "{FFCC33}Pick-up {FF0000}%d {FFCC33}|| Pick-up ID: {FF0000}%i {FFCC33}was created.", pickups, Pickup);
    SendClientMessage(playerid, -1, string);
    pickups++;
    CreatePickup(Pickup, 1, X, Y, Z, -1);
    new INI:File = INI_Open(PickPath(pickups));
    INI_SetTag(File,"HY's Dynamic Pickups");
    INI_WriteInt(File,"Pick-up ID", Pickup);
    INI_WriteFloat(File,"Pick-up X", X);
    INI_WriteFloat(File,"Pick-up Y", Y);
    INI_WriteFloat(File,"Pick-up Z", Z);
    INI_Close(File);
    Pick[playerid][pX] = X;
    Pick[playerid][pY] = Y;
    Pick[playerid][pZ] = Z;
    Pick[playerid][pID] = Pickup;
    return 1;
}

stock PickPath(pickups)
{
    new string[128];
    format(string,sizeof(string),PATH,pickups);
    return string;
}

forward LoadPickup_data(playerid,name[],value[]);
public LoadPickup_data(playerid,name[],value[])
{
    INI_Int("pID",Pick[playerid][pID]);
    INI_Float("pX",Pick[playerid][pX]);
    INI_Float("pY",Pick[playerid][pY]);
    INI_Float("pY",Pick[playerid][pZ]);
    return 1;
}
All code, now it's workin' fine, but isn't loaded In-Game. What problem have above script?
Reply


Messages In This Thread
Help. :| - by HY - 11.12.2014, 16:44
Re: Help. :| - by Clad - 11.12.2014, 16:50
Re: Help. :| - by HY - 11.12.2014, 16:54
Re: Help. :| - by M4D - 11.12.2014, 16:55
Re: Help. :| - by HY - 11.12.2014, 17:00
Re: Help. :| - by Clad - 11.12.2014, 17:02
Re: Help. :| - by M4D - 11.12.2014, 17:07
Re: Help. :| - by HY - 11.12.2014, 17:23
Re: Help. :| - by Ryz - 11.12.2014, 17:36
Re: Help. :| - by HY - 11.12.2014, 17:38

Forum Jump:


Users browsing this thread: 2 Guest(s)