SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/03/2015, 05:58 PM   #1
Vladimir124
Little Clucker
 
Join Date: Feb 2015
Posts: 33
Reputation: 0
Default Help me please i trying to fix this 6 days ;(

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)
	}
Vladimir124 is offline   Reply With Quote
Old 03/03/2015, 06:02 PM   #2
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,830
Reputation: 114
Default Re: Help me please i trying to fix this 6 days ;(

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.
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 03/03/2015, 06:02 PM   #3
duteba
Big Clucker
 
Join Date: Jul 2009
Posts: 69
Reputation: 0
Default Re: Help me please i trying to fix this 6 days ;(

sorry wrong
duteba is offline   Reply With Quote
Old 03/03/2015, 06:09 PM   #4
Vladimir124
Little Clucker
 
Join Date: Feb 2015
Posts: 33
Reputation: 0
Default Re: Help me please i trying to fix this 6 days ;(

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])();
Vladimir124 is offline   Reply With Quote
Old 03/03/2015, 06:11 PM   #5
ATGOggy
Gangsta
 
Join Date: Sep 2014
Location: Ls-rcr
Posts: 850
Reputation: 52
Default Re: Help me please i trying to fix this 6 days ;(

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]); 
__________________
******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."


I give and want only fair reps. I hate this: "hey bro, I rep you, rep me plz

Click below if you wanna be amazed:
http://Paid2Refer.com/ref.php?refId=291262
ATGOggy is offline   Reply With Quote
Old 03/03/2015, 06:13 PM   #6
Vladimir124
Little Clucker
 
Join Date: Feb 2015
Posts: 33
Reputation: 0
Default Re: Help me please i trying to fix this 6 days ;(

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

That is my attempts to fix it
Vladimir124 is offline   Reply With Quote
Old 03/03/2015, 06:15 PM   #7
ATGOggy
Gangsta
 
Join Date: Sep 2014
Location: Ls-rcr
Posts: 850
Reputation: 52
Default Re: Help me please i trying to fix this 6 days ;(

Which is the 6336th line?
__________________
******: "I've said this before. People think that MySQL is some simple plug-and-play magic bullet that you can use to just make your mode instantly better. They don't realise that the "L" in "SQL" means "language". So instead of programming PAWN, and using a bit of this mystery thing, you are now programming in two languages at once. If you spend months learning PAWN, you should spend the same time learning SQL, if not more - it is probably the more complex of the two languages, and not something that just gets bolted on to the side."


I give and want only fair reps. I hate this: "hey bro, I rep you, rep me plz

Click below if you wanna be amazed:
http://Paid2Refer.com/ref.php?refId=291262
ATGOggy is offline   Reply With Quote
Old 03/03/2015, 06:16 PM   #8
Vladimir124
Little Clucker
 
Join Date: Feb 2015
Posts: 33
Reputation: 0
Default Re: Help me please i trying to fix this 6 days ;(

Code:
format(string2,sizeof(string2), "[Glasanje]: %s se izlogovao, glasanje je zavrseno! [%s]",plname[playerid]);
Vladimir124 is offline   Reply With Quote
Old 03/03/2015, 06:19 PM   #9
CalvinC
High-roller
 
CalvinC's Avatar
 
Join Date: Nov 2014
Location: Denmark
Posts: 1,830
Reputation: 114
Default Re: Help me please i trying to fix this 6 days ;(

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?
__________________
[Tutorial] Custom Playerdamage system
Desert Eagle's dealing too much damage, you want one-hit sniper kills, or damage based on body parts? Check this out.
CalvinC is offline   Reply With Quote
Old 03/03/2015, 06:19 PM   #10
ReD_HunTeR
Gangsta
 
ReD_HunTeR's Avatar
 
Join Date: Nov 2012
Posts: 572
Reputation: 54
Default Re: Help me please i trying to fix this 6 days ;(

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/ban [DAYS] PrivatioBoni Scripting Help 1 12/12/2014 12:48 AM
7 Days to Die [___]Shane Everything and Nothing 1 28/07/2013 02:15 AM
7 days to die FireCat Everything and Nothing 43 22/07/2013 08:29 AM


All times are GMT. The time now is 04:52 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.