09.07.2016, 09:15
I tried to make this but it gives me errors when im compiling
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];
new targetid = ReturnUser(inputtext);
GetPlayerName(playerid, targetid, MAX_PLAYER_NAME);
if(!strcmp(gowner[gsaveid[playerid]], targetid))
{
format(astring, 128, ""COL_WHITE"%s is already the owner of the gate %i", targetid, gsaveid[playerid]);
SendClientMessage(playerid, -1, astring);
}
else
{
new INI:gatefile = INI_Open(GateINI(gsaveid[playerid]));
INI_SetTag(gatefile, "data");
INI_WriteString(gatefile, "owner", targetid);
INI_Close(gatefile);
if (!strcmp(ostring, "none")) format(astring, 128, ""COL_GREEN"You have set %s to be the owner of the gate %i.", targetid, 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], targetid);
SendClientMessage(playerid, -1, astring);
}
}
}
}