Help me please i trying to fix this 6 days ;(
#1

Look i have a with MY gamemode (becouse some guys sad its UnitedGaming RPG its not!)

I finish everything and when i convert it show me this

Code:
C:\Users\Vlada\Desktop\UGRPG.pwn(6336) : error 029: invalid expression, assumed zero
C:\Users\Vlada\Desktop\UGRPG.pwn(6336) : error 035: argument type mismatch (argument 1)
C:\Users\Vlada\Desktop\UGRPG.pwn(6336) : error 017: undefined symbol "string"
C:\Users\Vlada\Desktop\UGRPG.pwn(6336) : fatal error 107: too many error messages on one line
this is that lines and more
Code:
public OnPlayerDisconnect(playerid, reason)
{
	new textreason[64];
	new plname[8];
	new playersip[8];
	GetPlayerName(playerid, plname, sizeof(plname));
	GetPlayerIp(playerid, playersip, sizeof(playersip));
	SafeResetPlayerWeapons(playerid);
	if(PlayerInfo[playerid][pAdminDuty] == 1)
	{
		SafeResetPlayerWeapons(playerid);
	}
	if(Searching[playerid] == 1)
	{
		RemovePlayerMapIcon(playerid, 500 + playerid);
		Searching[playerid] = 0;
	}
	if(Ronned[playerid] >= 1)
	{
	    KillTimer(RonnTimer[playerid]);
	}
	if(PlayerCuffed[playerid])
	{
	    KillTimer(cufftimer[playerid]);
	}
	if(playerid == beingvoted)
	{
	    KillTimer(votetimer1);
	    KillTimer(votetimer2);
	    format(string2,sizeof(string), "[Glasanje]: %s se izlogovao, glasanje je zavrseno! [%s]",plname[playerid])();                <--- HERE IS THE ERROR
	    SendClientMessageToAll(TEAM_GROVE_COLOR,string2);
        votetimer1 = SetTimer("ResetVotation",300000,false);
	}
	if(PlayerCuffed[playerid] > 0)
	{
	    KillTimer(cufftimer[playerid]);
	}

	if(Tazer[playerid] == 1) { SafeGivePlayerWeapon(playerid, 24, PreTazerAmmo[playerid]); }
	Delete3DTextLabel(DutyLabel[playerid]);
	Delete3DTextLabel(AfkLabel[playerid]);
	gActivePlayers[playerid]--;
	numplayers--;
	RemovePlayerMapIcon(playerid, 37 + playerid);
	TextDrawDestroy(Textdraw64[playerid]);
	TextDrawDestroy(Textdraw54[playerid]);
	TextDrawDestroy(Textdraw53[playerid]);
	TextDrawDestroy(Textdraw52[playerid]);
	TextDrawDestroy(Textdraw51[playerid]);
	TextDrawDestroy(Textdraw49[playerid]);
	TextDrawDestroy(Textdraw42[playerid]);
	TextDrawDestroy(Textdraw41[playerid]);
	TextDrawDestroy(Textdraw40[playerid]);
	TextDrawDestroy(Textdraw39[playerid]);
	TextDrawDestroy(Textdraw1[playerid]);
	KillTimer(TrainTimer[playerid]);
	KillTimer(MoneyTimer[playerid]);
	else if(reason == 2)
	{
		strmid(PlayerInfo[playerid][pWhyLeft], "Kickovan/Banovan", 0, strlen("Kickovan/Banovan"), 255);
	}
	SaveGuns(playerid);
	OnPlayerUpdateEx(playerid);
	if(OfficerCourseStep[playerid] != 255)
	{
	    SafeGivePlayerMoney(playerid, -2500);
	}
	if(OnOfficerTest[playerid] != 0)
	{
	    SafeGivePlayerMoney(playerid, -5000);
	}
	if(ServerRestarted == 0)
	{
	    UpdatePlayerPosition(playerid)
	}
Reply
#2

You haven't used any if before this, so how would you use an else?
pawn Code:
else if(reason == 2)
Also, the max player name should be MAX_PLAYER_NAME or 24, while the max player IP is 16, not 8.
It clearly also specifies on the wiki that the IP cannot be gotten in OnPlayerDisconnect:
Quote:

This function does not work when used in OnPlayerDisconnect because the player is already disconnected. It will return an invalid IP (255.255.255.255). Save players' IPs under OnPlayerConnect if they need to be used under OnPlayerDisconnect.

Reply
#3

sorry wrong
Reply
#4

I know that about else and eveything some guys before say me that but that's not the problem problem is

Code:
format(string2,sizeof(string), "[Glasanje]: %s se izlogovao, glasanje je zavrseno! [%s]",plname[playerid])();
Reply
#5

Change this line :
PHP Code:
format(string2,sizeof(string), "[Glasanje]: %s se izlogovao, glasanje je zavrseno! [%s]",plname[playerid])(); 
to this:
PHP Code:
format(string2,sizeof(string2), "[Glasanje]: %s se izlogovao, glasanje je zavrseno! [%s]",plname[playerid]); 
Reply
#6

I try that before it's don't make any changes

That is my attempts to fix it
Reply
#7

Which is the 6336th line?
Reply
#8

Code:
format(string2,sizeof(string2), "[Glasanje]: %s se izlogovao, glasanje je zavrseno! [%s]",plname[playerid]);
Reply
#9

You defined it as plname, so remove the "[playerid]", and make sure you changed the other stuff i said, like putting it to 24 / MAX_PLAYER_NAME, otherwise it wont work.
And where have you defined string2?
Reply
#10

pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
        new string[128]; // I Guess you forgot this :P
    new textreason[64];
    new plname[8];
    new playersip[8];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)