08.07.2016, 23:00
(
Последний раз редактировалось MayaEU; 08.07.2016 в 23:19.
Причина: wrong code....
)
Hello, when i set gate owner and we are two, or more online
i can only set Id 0 as the owner, even if i type the name of id 2, it just says "id 0 is already the owner
what is wrong?
i can only set Id 0 as the owner, even if i type the name of id 2, it just says "id 0 is already the owner
what is wrong?
pawn Код:
if (dialogid == DIALOG_NEWGOWNER)
{
if (response)
{
new ostring[MAX_PLAYER_NAME], astring[128];
strcpy(ostring, gowner[gsaveid[playerid]]);
//new plid;
if (sscanf(inputtext, "u", playerid)) SendClientMessage(playerid, -1, ""COL_RED"Invalid Player ID/Name");
else if (playerid == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, ""COL_RED"Invalid Player");
else
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
if(!strcmp(gowner[gsaveid[playerid]], pname))
{
format(astring, 128, ""COL_WHITE"%s is already the owner of the gate %i", pname, gsaveid[playerid]);
SendClientMessage(playerid, -1, astring);
}
else
{
new INI:gatefile = INI_Open(GateINI(gsaveid[playerid]));
INI_SetTag(gatefile, "data");
INI_WriteString(gatefile, "owner", pname);
INI_Close(gatefile);
if (!strcmp(ostring, "none")) format(astring, 128, ""COL_GREEN"You have set %s to be the owner of the gate %i.", pname, gsaveid[playerid]);
else format(astring, 128, ""COL_GREEN"%s is no longer the owner of the gate %i. %s is the new owner", ostring, gsaveid[playerid], pname);
SendClientMessage(playerid, -1, astring);
}
}
}
}