SA-MP Forums Archive
[Ajuda] Motivo em comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Motivo em comando (/showthread.php?tid=428436)



Motivo em comando - WotusPower - 05.04.2013

Olб, preciso de uma ajuda.
Quero o seguinte:
Que o Admin tenha que por o motivo. EX:

/prender [ID] [tempo] [Motivo]

Code:

Quote:

if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "|ERRO| /prender [ id ] [ minutos]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Comando executado com sucesso!", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
format(string, sizeof(string), "|PRISГO| Vocк foi preso pelo administrador %s", sendername);
SendClientMessage(playa, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 6;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
SetPlayerPos(playa, 2695.0466,-2125.5537,13.548;
format(string, sizeof(string), "Voce foi preso por %d Minutos", money);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "|ERRO| Vocк nгo tem permissгo!");
}
}
return 1;
}




Re: Motivo em comando - arakuta - 05.04.2013

https://sampforum.blast.hk/showthread.php?tid=277842


Re: Motivo em comando - silenthill - 05.04.2013

pawn Код:
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, Vermelho, "/prender [id] [motivo]");
return 1;
}
msg = strrest(cmdtext, idx);
if(!strlen(msg)){
SendClientMessage(playerid, COLOR_GREEN,"| ERRO | Use /prender [id] [motivo]");
return 1;
}
if(!IsPlayerConnected(plid)){
SendClientMessage(playerid, Vermelho, "(ERRO) Jogador nгo conectado.");
return 1;
veja o que vc pode add


Re: Motivo em comando - DevilAgain - 10.04.2013

UP UP


Re: Motivo em comando - Smoking_Script - 12.04.2013

Quote:

if(strcmp(cmd, "/prender", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "|ERRO| Use /prender [ id ] [ minutos]");
return 1;
}
msg = strrest(cmdtext, idx);
if(!strlen(msg)){
SendClientMessage(playerid, COLOR_GREEN,"| ERRO | Use /prender [id] [motivo]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Comando executado com sucesso!", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 6;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
SetPlayerPos(playa, 2695.0466,-2125.5537,13.548;
format(string, sizeof(string), "|PRISГO| Vocк foi preso pelo administrador %s e ficara %d Minutos Preso Motivo: %s", sendername,money,msg);
SendClientMessage(playa, COLOR_LIGHTRED, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "|ERRO| Vocк nгo tem permissгo!");
}
}
return 1;
}

Espero ter ajudado '-'