28.10.2013, 08:48
hi, I made 2 commands, (ycmd + yini), changing the string values:
pEmail (e-mail)
pLook (players IC look)
but, it's ok when i player open his File, (by the command), and it Saves to a "Email", or "Look"..
But then I've to re-log to save my stats, and load it again,
Thats really anoying so i decided to make,
/email [e-mail] and it with strmid should extract my string to my Email variable, right?
Using code below, when I perform command /email (or /look),
etc. /email [samp@forum.sa-mp.com] //
it saves to my variable this " ", a.k.a. blank string,
Help please
[rep+]
pEmail (e-mail)
pLook (players IC look)
but, it's ok when i player open his File, (by the command), and it Saves to a "Email", or "Look"..
But then I've to re-log to save my stats, and load it again,
Thats really anoying so i decided to make,
/email [e-mail] and it with strmid should extract my string to my Email variable, right?
Using code below, when I perform command /email (or /look),
etc. /email [samp@forum.sa-mp.com] //
it saves to my variable this " ", a.k.a. blank string,
Help please

pawn Код:
enum pInfo
{
pEmail[128],
pLook[128]
}
// now commands
YCMD:email(playerid, params[], help)
{
#pragma unused help
new email[46], emailstring[128], string[128];
if(sscanf(params, "s[128]", email))
return SCM(playerid, COLOR_GRAY, "Usage: /email [your new email]");
else if(strlen(email) < 6 || strlen(email) > 64)
return SCM(playerid, COLOR_GRAY, "*Your email shouldn't containt less than 6 or above 64 chars!");
format(emailstring, sizeof(emailstring), "%s", email);
strmid(PlayerInfo[playerid][pEmail], emailstring, 0, strlen(emailstring));
format(string, sizeof(string), "Success, your new email: %s", email);
SCM(playerid, COLOR_YELLOW, string);
return 1;
}
YCMD:setlook(playerid, params[], help)
{
#pragma unused help
new string[128], text[128], lookstring[128];
if(sscanf(params, "s", text))
return SCM(playerid, COLOR_GRAY, "Usage: /setlook [your new look]");
format(lookstring, sizeof(lookstring), "%s", text);
strmid(PlayerInfo[playerid][pLook], lookstring, 0, strlen(lookstring));
SCM(playerid, SBLUE, "Success, your new look:");
format(string, sizeof(string), "%s %s", PlayerName(playerid), text);
SCM(playerid, SBLUE, string);
return 1;
}
pawn Код:
YCMD:myemail(playerid, params[], help)
{
#pragma unused help
new string[128];
format(string, sizeof(string), "Your email: %s", PlayerInfo[playerid][pEmail]);
SCM(playerid, COLOR_YELLOW, string);
return 1;
}
YCMD:showyourself(playerid, params[], help)
{
#pragma unused help
new string[128];
format(string, sizeof(string), "**%s %s.", PlayerName(playerid), PlayerInfo[playerid][pLook]);
ProxDetector(30.0, playerid, string, SBLUE, SBLUE, SBLUE, SBLUE, SBLUE);
return 1;
}