how would i convert this to zcmd + sscanf - 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)
+--- Thread: how would i convert this to zcmd + sscanf (
/showthread.php?tid=507067)
how would i convert this to zcmd + sscanf -
Yves - 15.04.2014
just wanted to know how i can change this to zcmd and sscanf
Код:
COMMAND:changepass(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(Logged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You are not logged in !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Function: {FFFFFF}/changepass [password]");
return 1;
}
strmid(PlayerInfo[playerid][pKey], tmp, 0, strlen(cmdtext), 255);
UpdatePlayerInfo(playerid);
SendClientMessage(playerid, COLOR_Milito, "Your password has been changed as you requested.");
}
return 1;
}
Re: how would i convert this to zcmd + sscanf -
iZN - 15.04.2014
Why are you even checking if the player is connected. That's obvious that connected player would type it.
pawn Код:
COMMAND:changepass(playerid, params[]) // Already ZCMD?
{
if(Logged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_RED, "You are not logged in !");
return 1;
}
static tmp[128]; // if you have already remove this.
if(sscanf(params, "s[128]", tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Function: {FFFFFF}/changepass [password]");
return 1;
}
strmid(PlayerInfo[playerid][pKey], tmp, 0, strlen(cmdtext), 255);
UpdatePlayerInfo(playerid);
SendClientMessage(playerid, COLOR_Milito, "Your password has been changed as you requested.");
return 1;
}
Re: how would i convert this to zcmd + sscanf -
Yves - 15.04.2014
Quote:
Originally Posted by iZN
Why are you even checking if the player is connected. That's obvious that connected player would type it.
pawn Код:
COMMAND:changepass(playerid, params[]) // Already ZCMD? { if(Logged[playerid] == 0) { SendClientMessage(playerid, COLOR_RED, "You are not logged in !"); return 1; } static tmp[128]; if(sscanf(params, "s[128]", tmp)) { SendClientMessage(playerid, COLOR_GRAD1, "Function: {FFFFFF}/changepass [password]"); return 1; }
strmid(PlayerInfo[playerid][pKey], tmp, 0, strlen(cmdtext), 255); UpdatePlayerInfo(playerid); SendClientMessage(playerid, COLOR_Milito, "Your password has been changed as you requested."); return 1; }
|
i didn't code this it was on limit less gaming script am trying to convert it etc, thanks but what about this part
strmid(PlayerInfo[playerid][pKey], tmp, 0, strlen(cmdtext), 255);