PDA

View Full Version : zcmd+sscanf


Jimmi
31/07/2015, 03:39 PM
Can you please pass the command/unfreeze on the zcmd + sscanf?

if(strcmp(cmd, "/unfreeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /unfreeze [playerid]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTrial] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s i-a dat unfreeze lui %s",sendername, giveplayer);
IsFreezed[playa] = 0;
printf("%s",string);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s a primit unfreeze de la %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
ExecCMD[playerid]++;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "** Nu ai rangul administrativ necesar!");
}
}
SaveExecCMDS(playerid, "/unfreeze", ExecCMD[playerid]);
return 1;
}

Jimmi
31/07/2015, 04:08 PM
uppppp

ZToPMaN
31/07/2015, 04:22 PM
#include <ZCMD>
#include <sscanf>
CMD:unfreeze(playerid, params[])
{
if(IsPlayerConnected(playerid))
new id;
if(sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /unfreeze [playerid]");
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTrial] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s i-a dat unfreeze lui %s",sendername, giveplayer);
IsFreezed[playa] = 0;
printf("%s",string);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s a primit unfreeze de la %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
ExecCMD[playerid]++;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "** Nu ai rangul administrativ necesar!");
}
}
SaveExecCMDS(playerid, "/unfreeze", ExecCMD[playerid]);
return 1;
}
try this

Fancy
31/07/2015, 04:22 PM
Converted in zcmd
CMD:unfreeze(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /unfreeze [playerid]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTrial] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s i-a dat unfreeze lui %s",sendername, giveplayer);
IsFreezed[playa] = 0;
printf("%s",string);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s a primit unfreeze de la %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
ExecCMD[playerid]++;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "** Nu ai rangul administrativ necesar!");
}
}
SaveExecCMDS(playerid, "/unfreeze", ExecCMD[playerid]);
return 1;
}

Jimmi
31/07/2015, 04:26 PM
and sscanf?

ZToPMaN
31/07/2015, 04:27 PM
I wrote it to u in sscanf and zcmd, see the first reply.

Jimmi
31/07/2015, 04:42 PM
And you please arrange command

Jimmi
31/07/2015, 08:08 PM
upppppppppppppppppp

Jefff
31/07/2015, 09:05 PM
CMD:unfreeze(playerid, cmdtext[])
{
new playa;
if(PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pTrial] < 1) SendClientMessage(playerid, COLOR_GRAD1, "** Nu ai rangul administrativ necesar!");
else if(sscanf(cmdtext, "u", playa)) SendClientMessage(playerid, COLOR_GRAD2, "{00FF00}Folosire:{FFFFFF} /unfreeze [playerid / part of name]");
else
{
if(playa != INVALID_PLAYER_ID && IsPlayerConnected(playa))
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 1);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s i-a dat unfreeze lui %s",sendername, giveplayer);
IsFreezed[playa] = 0;
printf("%s",string);
format(string, sizeof(string), "{0066FF}[Info:] {FFFFFF}%s a primit unfreeze de la %s",giveplayer ,sendername);
ABroadCast(COLOR_LIGHTRED,string,1);
ExecCMD[playerid]++;
}
}
SaveExecCMDS(playerid, "/unfreeze", ExecCMD[playerid]);
return 1;
}