SA-MP Forums Archive
Help me please i trying to fix this 6 days ;( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help me please i trying to fix this 6 days ;( (/showthread.php?tid=566115)



Help me please i trying to fix this 6 days ;( - Vladimir124 - 03.03.2015

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



Re: Help me please i trying to fix this 6 days ;( - CalvinC - 03.03.2015

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.




Re: Help me please i trying to fix this 6 days ;( - duteba - 03.03.2015

sorry wrong


Re: Help me please i trying to fix this 6 days ;( - Vladimir124 - 03.03.2015

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])();



Re: Help me please i trying to fix this 6 days ;( - ATGOggy - 03.03.2015

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



Re: Help me please i trying to fix this 6 days ;( - Vladimir124 - 03.03.2015

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

That is my attempts to fix it


Re: Help me please i trying to fix this 6 days ;( - ATGOggy - 03.03.2015

Which is the 6336th line?


Re: Help me please i trying to fix this 6 days ;( - Vladimir124 - 03.03.2015

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



Re: Help me please i trying to fix this 6 days ;( - CalvinC - 03.03.2015

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?


Re: Help me please i trying to fix this 6 days ;( - ReD_HunTeR - 03.03.2015

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