Name bugged
#5

Ok, well i updated Sscanf but now there is a new problem instead of the actual playerid the script shows 65635:

COMMAND:warn(playerid,params[])
{
new id,reason[128],pname[MAX_PLAYER_NAME],aname[MAX_PLAYER_NAME],sstring[MAX_PLAYER_NAME+128],astring[MAX_PLAYER_NAME+128],pstring[MAX_PLAYER_NAME+128];
GetPlayerName(playerid,aname,sizeof(aname));
GetPlayerName(id,pname,sizeof(pname));
if(alevel[playerid] >= 1)
{
if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid,0xFFFFFFFF,"Correct Usage: /warn id reason");
if(id == playerid) return SendClientMessage(playerid,0xFF0000FF,"You can not use this command on yourself!");
format(sstring,sizeof(sstring),"Administrator %s(%i) has warned %s(%i) for %s",aname,playerid,pname,id,reason);
format(astring,sizeof(astring),"You have warned %s(%i) for %s",pname,id,reason);
format(pstring,sizeof(pstring),"You have been warned by Administrator %s(%i) for %s",aname,playerid,reason);
SendClientMessageToAll(0xFF0000FF,sstring);
SendClientMessage(playerid,0xE38217,astring);
SendClientMessage(id,0xE38217,pstring);
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You are not authorized to use that command!");
}
return 1;
}
COMMAND:kick(playerid,params[])
{
new id,reason[128],pname[MAX_PLAYER_NAME],aname[MAX_PLAYER_NAME],sstring[MAX_PLAYER_NAME+128],astring[MAX_PLAYER_NAME+128],pstring[MAX_PLAYER_NAME+128];
GetPlayerName(playerid,aname,sizeof(aname));
GetPlayerName(id,pname,sizeof(pname));
if(alevel[playerid] >= 1)
{
if(sscanf(params,"us[128]",id,reason)) return SendClientMessage(playerid,0xFFFFFFFF,"Correct Usage: /kick id reason");
if(id == playerid) return SendClientMessage(playerid,0xFF0000FF,"You can not use this command on yourself!");
format(sstring,sizeof(sstring),"Administrator %s(%i) has kick %s from the server for %s",aname,playerid,pname,reason);
format(astring,sizeof(astring),"You have kicked %s from the server for %s",pname,reason);
format(pstring,sizeof(pstring),"You have been kicked from the server by Administrator %s(%i) for %s",aname,playerid,reason);
SendClientMessageToAll(0xFF0000FF,sstring);
SendClientMessage(playerid,0xE38217,astring);
SendClientMessage(id,0xE38217,pstring);
Kick(id);
}
else
{
SendClientMessage(playerid,0xFF0000FF,"You are not authorized to use that command!");
}
return 1;
}
Reply


Messages In This Thread
Name bugged - by jtemple042996 - 12.06.2012, 19:57
Re: Name bugged - by Yuryfury - 13.06.2012, 02:50
Re: Name bugged - by Aira - 13.06.2012, 05:45
Re: Name bugged - by JhnzRep - 13.06.2012, 05:49
Re: Name bugged - by jtemple042996 - 14.06.2012, 17:09
Re : Name bugged - by vernz - 14.06.2012, 17:11
Re: Name bugged - by Djole1337 - 14.06.2012, 17:15
Re: Name bugged - by Mike97300 - 14.06.2012, 19:06
Re: Name bugged - by jtemple042996 - 15.06.2012, 20:16
Re: Name bugged - by jtemple042996 - 18.06.2012, 01:52

Forum Jump:


Users browsing this thread: 1 Guest(s)