Jump to content
  • 0

Problema


teudan

Question

Buna seara, am incercat sa creez o comanda cu care sa modific numele, am creat'o a modific numele a creat un nou fisier dar  nu l-a sters pe vechiul, de ce?

[pawn]

if(strcmp(cmd, "/changename", true) == 0)

{

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))

        {

    if(!dini_Exists(string))

{

    SetPlayerName(giveplayerid, tmp);

format(string, sizeof(string),"** Your name was changne to %s by %s", tmp, playerid);

SendClientMessage(giveplayerid, COLOR_SEA, string);

format(string, sizeof(string),"** Succeful change %s's name", giveplayerid);

SendClientMessage(playerid, COLOR_SEA, string);

new housekey = PlayerInfo[giveplayerid][pPhousekey];

new bizzkey = PlayerInfo[giveplayerid][pPbiskey];

new carkey1 = PlayerInfo[giveplayerid][pPcarkey];

new carkey2 = PlayerInfo[giveplayerid][pPcarkey2];

format(string, sizeof(string),"%s",tmp);

if(PlayerInfo[giveplayerid][pPhousekey] != 9999)

{

    strmid(HouseInfo[housekey][hOwner],string,0,strlen(string),255);

    ProportionalUpdate(1,housekey);

    OnPropTextdrawUpdate(1, housekey);

    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* House ownership changed successfuly!");

}

if(PlayerInfo[giveplayerid][pPbiskey] != 9999)

{

    strmid(BizzInfo[bizzkey][bOwner],string,0,strlen(string),255);

    ProportionalUpdate(2,bizzkey);

    OnPropTextdrawUpdate(2, bizzkey);

    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* Business ownership changed successfuly!");

}

if(PlayerInfo[giveplayerid][pPcarkey] != 9999)

{

    strmid(CarInfo[carkey1][cOwner],string,0,strlen(string),255);

    ProportionalUpdate(4,carkey1);

    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* First Vehicle ownership changed successfuly!");

}

if(PlayerInfo[giveplayerid][pPcarkey2] != 9999)

{

    strmid(CarInfo[carkey2][cOwner],string,0,strlen(string),255);

    ProportionalUpdate(4,carkey2);

    OnPropTextdrawUpdate(1, housekey);

    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* Second Vehicle ownership changed successfuly!");

}

      format(string, sizeof(string), "LARP/Users/%s.ini", giveplayerid);

fremove(string);

format(string, sizeof(string), "LARP/Users/%s.ini", tmp);

dini_Create(string);

OnPlayerUpdateEx(giveplayerid);

ChangedName[playerid] = 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;

}

[/pawn]

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Încearc? asa:

if(strcmp(cmd, "/changename", true) == 0)
	{
		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))
		        {
	     			if(!dini_Exists(string))
					{
					    SetPlayerName(giveplayerid, tmp);
						format(string, sizeof(string),"** Your name was changne to %s by %s", tmp, playerid);
						SendClientMessage(giveplayerid, COLOR_SEA, string);
						format(string, sizeof(string),"** Succeful change %s's name", giveplayerid);
						SendClientMessage(playerid, COLOR_SEA, string);
						new housekey = PlayerInfo[giveplayerid][pPhousekey];
						new bizzkey = PlayerInfo[giveplayerid][pPbiskey];
						new carkey1 = PlayerInfo[giveplayerid][pPcarkey];
						new carkey2 = PlayerInfo[giveplayerid][pPcarkey2];
						format(string, sizeof(string),"%s",tmp);
						if(PlayerInfo[giveplayerid][pPhousekey] != 9999)
						{
						    strmid(HouseInfo[housekey][hOwner],string,0,strlen(string),255);
						    ProportionalUpdate(1,housekey);
						    OnPropTextdrawUpdate(1, housekey);
						    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* House ownership changed successfuly!");
						}
						if(PlayerInfo[giveplayerid][pPbiskey] != 9999)
						{
						    strmid(BizzInfo[bizzkey][bOwner],string,0,strlen(string),255);
						    ProportionalUpdate(2,bizzkey);
						    OnPropTextdrawUpdate(2, bizzkey);
						    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* Business ownership changed successfuly!");
						}
						if(PlayerInfo[giveplayerid][pPcarkey] != 9999)
						{
						    strmid(CarInfo[carkey1][cOwner],string,0,strlen(string),255);
						    ProportionalUpdate(4,carkey1);
						    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* First Vehicle ownership changed successfuly!");
						}
						if(PlayerInfo[giveplayerid][pPcarkey2] != 9999)
						{
						    strmid(CarInfo[carkey2][cOwner],string,0,strlen(string),255);
						    ProportionalUpdate(4,carkey2);
						    OnPropTextdrawUpdate(1, housekey);
						    SendClientMessage(giveplayerid, TEAM_GROVE_COLOR,"* Second Vehicle ownership changed successfuly!");
						}
      					format(string, sizeof(string), "LARP/Users/%s.ini", giveplayer);
						fremove(string);
						format(string, sizeof(string), "LARP/Users/%s.ini", tmp);
						dini_Create(string);
						OnPlayerUpdateEx(giveplayerid);
						ChangedName[playerid] = 1;
					}
				}
				else
				{
				    format(string, sizeof(string), "%d is not an active player.", giveplayer);
					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;
	}

i0418xcttya707ofg.jpg

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.