Little Problem -
Tanush123 - 31.08.2011
Why do i get a error when i use this
pawn Код:
SetPlayerColor(playerid,dini_Get(oFile,"Color"));
ERROR IS
pawn Код:
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\erclan.pwn(9453) : error 035: argument type mismatch (argument 2)
Re: Little Problem -
=WoR=G4M3Ov3r - 31.08.2011
(argument 2) means there's something wrong with dini_Get(oFile,"Color")
Why do you use it this way ?, won't it be alot simpler if you use it this way.
PHP код:
SetPlayerColor(playerid, colour)
Example:
PHP код:
SetPlayerColor(playerid, 0xB46F0000);
Re: Little Problem -
IceCube! - 31.08.2011
SetPlayerColor this its its own comma try this
pawn Код:
new color = dini_Get(oFile, "Color"));
SetPlayerColor(playerid, color);
I think... I'm not to sure
Re: Little Problem -
Davz*|*Criss - 31.08.2011
@Gameover
Dude he saves player's colour in an .ini file, So when player connects and logs in it just load its colour which was saved in .ini!
Thanks
Re: Little Problem -
=WoR=G4M3Ov3r - 31.08.2011
Quote:
Originally Posted by Davz*|*Criss
@Gameover
Dude he saves player's colour in an .ini file, So when player connects and logs in it just load its colour which was saved in .ini!
Thanks
|
Well, i don't use dini.. so i don't have much experience in it.
then you should add a new colour
PHP код:
new color = dini_Get(oFile,"Color"))
And it should work fine..
Re: Little Problem -
Tanush123 - 31.08.2011
FOR THE SECOND POST
pawn Код:
D:\Users\Tanush\Desktop\SA-MP Server Stunt\gamemodes\erclan.pwn(9449) : error 033: array must be indexed (variable "-unknown-")
And i need dini_Get because im making a dynamic org so i made /setocolor (set organization color)
pawn Код:
CMD:setocolor(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"ii",orgid,ocolor)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setocolor [orgid] [samp hex color]");
format(oFile,sizeof(oFile),"DynamicOrgs/%i.ini",orgid);
{
if(!dini_Exists(oFile)) return SendClientMessage(playerid,red,"ERROR: That Organization Id is INVALID!");
dini_IntSet(oFile,"Color",ocolor);
}
return 1;
}
Re: Little Problem -
Vince - 31.08.2011
Aw .. Another case of someone thinking that colors are strings. All colors used within sa:mp scripting are numbers, they're just represented in hex most of the time for easier reading.
You can just save the colors as numbers and read them as numbers. You'll have something like this in the file: 16711935 (which is green, written in decimal notation). This means you'll have to use dini_Int and dini_IntSet instead of dini_Get and dini_Set.
Re: Little Problem -
Tanush123 - 31.08.2011
Thank you Vince but i got a problem, if i do /setocolor 1 0xFF0000FF on the dini file it shows Color=48
pawn Код:
CMD:setocolor(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
if(sscanf(params,"is",orgid,ocolor)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /setocolor [orgid] [samp hex color]");
format(oFile,sizeof(oFile),"DynamicOrgs/%i.ini",orgid);
{
if(!dini_Exists(oFile)) return SendClientMessage(playerid,red,"ERROR: That Organization Id is INVALID!");
dini_IntSet(oFile,"Color",ocolor);
}
return 1;
}