name problem
#1

Hi all when i use the cmds it dont show who did to who

this is the freeze cmd "Admin %s has frozen %s|Reason: %s"

ScreenShot: http://8pic.ir/images/is3qs6z40d9spky8g89u.png


it dont show the names please help
Reply
#2

show cmd code
Reply
#3

this is freeze code
Quote:

CMD:freeze(playerid, params[])
{
if(pInfo[playerid][Adminlevel]< 1) return SCM(playerid, Red, "You're not authorized to use this command");
new
targetid,reason[48],string[128];
if(sscanf(params, "us[48]", targetid,reason)) return SCM(playerid,-1,"USAGE: /freeze [playerid] [reason]");
TogglePlayerControllable(targetid, false);
pInfo[targetid][Freeze] = 1;
format(string,sizeof(string),"Admin %s has frozen %s|Reason: %s",GN(playerid),GN(targetid),reason);
SCMToAll(Red,string);
return 1;
}

Reply
#4

Quote:
Originally Posted by SHE790
Посмотреть сообщение
this is freeze code
Only freeze code?
Reply
#5

Quote:
Originally Posted by SturtIndia
Посмотреть сообщение
Only freeze code?
No all the cmds :/
Quote:
Originally Posted by ******
Посмотреть сообщение
You don't check if the target is connected.
can u give me a example please?
Reply
#6

Do
if(!sscanf(params, "us[48]", targetid,reason)) return SCM(playerid,-1,"USAGE: /freeze [playerid] [reason]");
Please tell me if I am wrong not so good with it.

pawn Код:
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ERROR: Wrong player ID");
if(targetid == playerid) return SendClientMessage(playerid,-1,"ERROR: You cant freeze yourself!");
new tname[MAX_PLAYER_NAME];
GetPlayerName(targetid,tname,sizeof(tname));
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
I hope this helped
Reply
#7

Quote:
Originally Posted by Brezon
Посмотреть сообщение
Do
if(!sscanf(params, "us[48]", targetid,reason)) return SCM(playerid,-1,"USAGE: /freeze [playerid] [reason]");
Please tell me if I am wrong not so good with it.
it should be like this:
pawn Код:
if(!sscanf(params, "us[48]", targetid,reason)) return SCM(playerid,-1,"USAGE: /freeze [playerid] [reason]");
Please use [ PAWN ] [ /PAWN ] before typing any pawno code
Reply
#8

Quote:
Originally Posted by Brezon
Посмотреть сообщение
Do
if(!sscanf(params, "us[48]", targetid,reason)) return SCM(playerid,-1,"USAGE: /freeze [playerid] [reason]");
Please tell me if I am wrong not so good with it.

pawn Код:
if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ERROR: Wrong player ID");
if(Target == playerid) return SendClientMessage(playerid,-1,"ERROR: You cant freeze yourself!");
new tname[MAX_PLAYER_NAME];
GetPlayerName(Target,tname,sizeof(tname));
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
I hope this helped
no it didnt
Reply
#9

Still it dont show the names
Reply
#10

Код:
CMD:freeze(playerid, params[])
{
if(pInfo[playerid][Adminlevel]< 1) return SCM(playerid, Red, "You're not authorized to use this command");
new targetid,reason[48];
if(sscanf(params, "us[48]", targetid,reason))
{
SCM(playerid,-1,"USAGE: /freeze [playerid] [reason]");
return 1;
}
else
{
if(IsPlayerConnected(targetid) && targetid != INVALID_PLAYER_ID)
{
new string[128],name1[MAX_PLAYER_NAME+1],name2[MAX_PLAYER_NAME+1];
TogglePlayerControllable(targetid, false);
pInfo[targetid][Freeze] = 1;
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(targetid,name2,sizeof(name2));
format(string,sizeof(string),"Admin %s has frozen %s|Reason: %s",name1,name2,reason);
SCMToAll(Red,string);
}
else
{
SCM(playerid, Red, "Player is not connected/valid");
return 1;
}
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)