SA-MP Forums Archive
[Help] Problems with ingame setmapicon - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Problems with ingame setmapicon (/showthread.php?tid=130913)



[Help] Problems with ingame setmapicon - Niixie - 28.02.2010

Hey Samp forum.
-I've tried 2 different ways to make a command like /setmapicon
and then it saves the pos, iconid and markertype in a file. when a player login then he should load the file aka. he should load the icons. but i've failled.
i made one there was 666 lines long and now i had to delete it..
Hellfire gave me this:

pawn Код:
CMD:setmapicon(playerid, params[])
{
    new ID, Type, string[128];
    if(sscanf(params, "dd", ID, Type)) ERRORMSG(playerid, "[WR Usage]: /setmapicon <Iconid> <Marker Type>");
    else if(IDused[ID] == true)
    {
      format(string, sizeof(string), "[WR Server]: That iconid is in use! try %i+1", ID);
        ERRORMSG(playerid, string);
    }
    else
    {
        new Float:Loc[3];
        new idstr[3];
        format(idstr, 3, "%d", ID);
        GetPlayerPos(playerid, Loc[0], Loc[1], Loc[2]);
        dini_Set("Icons", idstr, "SetPlayerMapIcon(playerid, %d, %f, %f, %f, %d, 0)" ID, Loc[0], Loc[1], Loc[2], Type);
    }
    return 1;
}
but it has some errors.
Anyone got a easy way to make this command so it saves and loads?


Re: [Help] Problems with ingame SetPlayerMapIcon - Niixie - 28.02.2010

Quote:
Originally Posted by Niixie
Hey Samp forum.
-I've tried 2 different ways to make a command like /setmapicon
and then it saves the pos, iconid and markertype in a file. when a player login then he should load the file aka. he should load the icons. but i've failled.
i made one there was 666 lines long and now i had to delete it..
Hellfire gave me this:

pawn Код:
CMD:setmapicon(playerid, params[])
{
    new ID, Type, string[128];
    if(sscanf(params, "dd", ID, Type)) ERRORMSG(playerid, "[WR Usage]: /setmapicon <Iconid> <Marker Type>");
    else if(IDused[ID] == true)
    {
      format(string, sizeof(string), "[WR Server]: That iconid is in use! try %i+1", ID);
        ERRORMSG(playerid, string);
    }
    else
    {
        new Float:Loc[3];
        new idstr[3];
        format(idstr, 3, "%d", ID);
        GetPlayerPos(playerid, Loc[0], Loc[1], Loc[2]);
        dini_Set("Icons", idstr, "SetPlayerMapIcon(playerid, %d, %f, %f, %f, %d, 0)" ID, Loc[0], Loc[1], Loc[2], Type);
    }
    return 1;
}
but it has some errors.
Anyone got a easy way to make this command so it saves and loads?



Re: [Help] Problems with ingame setmapicon - Niixie - 01.03.2010

Bump?


Re: [Help] Problems with ingame setmapicon - BlackFoX - 01.03.2010

Код:
if(!strcmp(cmdtext,"/mapsave",true,8))
{
	if(!cmd[10])return SendClientMessage(playerid,0xFF0000FF,"Use /mapsave [markertyp]");
	new Float:pos[3];
	GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
	new File:iox = fopen("markers.txt",io_append);
	new fmstr[128];
	format(fmstr,sizeof fmstr,"SetPlayerMapIcon(playerid,iconid,%f,%f,%f,%d,0);\r\n",
	pos[0],pos[1],pos[2],strval(cmdtext[10]));
	fwrite(iox,fmstr);
	fclose(iox);	
	return 1;
}



Re: [Help] Problems with ingame setmapicon - Niixie - 07.03.2010

Quote:
Originally Posted by BlackFoX_UD_
Код:
if(!strcmp(cmdtext,"/mapsave",true,8))
{
	if(!cmd[10])return SendClientMessage(playerid,0xFF0000FF,"Use /mapsave [markertyp]");
	new Float:pos[3];
	GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
	new File:iox = fopen("markers.txt",io_append);
	new fmstr[128];
	format(fmstr,sizeof fmstr,"SetPlayerMapIcon(playerid,iconid,%f,%f,%f,%d,0);\r\n",
	pos[0],pos[1],pos[2],strval(cmdtext[10]));
	fwrite(iox,fmstr);
	fclose(iox);	
	return 1;
}
Ahh, yes i have that.
I need to know how to load it, when it have been saved to a file.


Re: [Help] Problems with ingame setmapicon - aircombat - 07.03.2010

Dini/DUBD??
________
Box Vaporizer


Re: [Help] Problems with ingame setmapicon - Niixie - 07.03.2010

Yeees, dini/dudb. but how?