Command Help [REP ++] - 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: Command Help [REP ++] (
/showthread.php?tid=427665)
Command Help [REP ++] -
teomakedonija - 02.04.2013
Hi All.I need help with the my command.
I maked command to set a admin panel password but now i should to put a Numbers.I want to make it with charachters ? How to make that ?
pawn Код:
//------------------------------------------------------------------------------
if(strcmp(cmd, "/setapw", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{37F906}INFO:{FFFFFF}/setapw [ID/Ime na Igrac] [pw]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{37F906}INFO:{FFFFFF}/setapw [ID/Ime na Igrac] [pw]");
return 1;
}
// new playa;
// playa = ReturnUser(tmp);
moneys = strval(tmp);
PlayerInfo[giveplayerid][pAdminPw] = moneys;
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"{37F906}INFO:{FFFFFF}Admin %s ti namesti %d lozinka na Admin Panel.",sendername,moneys);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string),"{37F906}INFO:{FFFFFF}Mu namestivte %d Admin Password, na %s za Admin Panel.",moneys,giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SacuvajIgraca(giveplayerid);
}
}
else
{
SCM(playerid, WHITE,"{FF4040}GRESKA:{FFFFFF}Ne ste ovlasteni za Ovaa Komanda.");
return 1;
}
return 1;
}
Re: Command Help [REP ++] -
brawrr - 02.04.2013
try this
PHP код:
//------------------------------------------------------------------------------
if(strcmp(cmd, "/setapw", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{37F906}INFO:{FFFFFF}/setapw [ID/Ime na Igrac] [pw]");
return 1;
}
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "{37F906}INFO:{FFFFFF}/setapw [ID/Ime na Igrac] [pw]");
return 1;
}
new moneys[256];
moneys = strtok(cmdtext,idx);
format(PlayerInfo[giveplayerid][pAdminPw], sizeof(PlayerInfo[giveplayerid][pAdminPw]), "%s", moneys);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string),"{37F906}INFO:{FFFFFF}Admin %s ti namesti %s lozinka na Admin Panel.",sendername,moneys);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string),"{37F906}INFO:{FFFFFF}Mu namestivte %s Admin Password, na %s za Admin Panel.",moneys,giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
SacuvajIgraca(giveplayerid);
}
}
else
{
SCM(playerid, WHITE,"{FF4040}GRESKA:{FFFFFF}Ne ste ovlasteni za Ovaa Komanda.");
return 1;
}
return 1;
}
Re: Command Help [REP ++] -
teomakedonija - 02.04.2013
Show me a erors in line format(PlayerInfo[giveplayerid][pAdminPw], sizeof(PlayerInfo[giveplayerid][pAdminPw]), "%s", moneys); - Indifener - ... Help
Re: Command Help [REP ++] -
teomakedonija - 02.04.2013
Fast Helppp :@@
Re: Command Help [REP ++] -
MP2 - 02.04.2013
Not when you bump, double-post and DEMAND things. We're volunteers - not workers. We don't get paid to help you and we don't appreciate being ordered about.
Re: Command Help [REP ++] -
teomakedonija - 02.04.2013
I fixed alone