05.09.2009, 18:15
I need a /changename command, I have searched for hours?!
if(strcmp(cmd, "/changename", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new tmpp[256]; tmpp = strtok(cmdtext, idx); if(!strlen(tmpp)) { SendClientMessage(playerid, COLOR_DBLUE, "Correct SYNTAX: /changename [playerid] [new nick]"); return 1; } giveplayerid = strval(tmpp); tmp = strtok(cmdtext, idx); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerConnected(giveplayerid)) { SetPlayerName(giveplayerid, tmp); format(string, sizeof(string), "AdmCMD: %s(%i) has changed Your name to %s", sendername, playerid, tmp); SendClientMessage(giveplayerid, COLOR_DBLUE, string); format(string, sizeof(string), "AdmCMD: You have changed ID %i's name to %s", giveplayerid, tmp); SendClientMessage(playerid, COLOR_DBLUE, string); format(string, 256, "AdmWarning: %s has changed %s's his name to %s.", sendername,giveplayer, tmp); ABroadCast(COLOR_YELLOW,string,1); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } } else { SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!"); } } else { SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!"); } return 1; }
Originally Posted by Lonka
Here is it mate
Код:
if(strcmp(cmd, "/changename", true) == 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new tmpp[256]; tmpp = strtok(cmdtext, idx); if(!strlen(tmpp)) { SendClientMessage(playerid, COLOR_DBLUE, "Correct SYNTAX: /changename [playerid] [new nick]"); return 1; } giveplayerid = strval(tmpp); tmp = strtok(cmdtext, idx); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pAdmin] >= 1337) { if(IsPlayerConnected(giveplayerid)) { SetPlayerName(giveplayerid, tmp); format(string, sizeof(string), "AdmCMD: %s(%i) has changed Your name to %s", sendername, playerid, tmp); SendClientMessage(giveplayerid, COLOR_DBLUE, string); format(string, sizeof(string), "AdmCMD: You have changed ID %i's name to %s", giveplayerid, tmp); SendClientMessage(playerid, COLOR_DBLUE, string); format(string, 256, "AdmWarning: %s has changed %s's his name to %s.", sendername,giveplayer, tmp); ABroadCast(COLOR_YELLOW,string,1); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_RED, string); } } else { SendClientMessage(playerid, COLOR_RED, "You do not have permission to use that command!"); } } else { SendClientMessage(playerid, COLOR_RED, "You Must be logged in to use this command!"); } return 1; } |
Originally Posted by x-ray313
Quote:
|
Originally Posted by x-ray313
Quote:
|
new
string[128];
if(!strcmp(cmdtext,"/changename",true))
{
new name[MAX_PLAYER_NAME];
if(cmdtext[idx++]!=32||cmdtext[idx]=='\0') return SendClientMessage(playerid,color,"/changename [new name]");
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s changed name to %s.",name,cmdtext[idx]);
SendClientMessageToAll(color,string);
SetPlayerName(playerid,cmdtext[idx]);
return 1;
}
Originally Posted by MenaceX^
Quote:
pawn Код:
|
Originally Posted by x-ray313
Quote:
|
Originally Posted by MenaceX^
Quote:
|