SA-MP Forums Archive
Warning 202 - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Warning 202 (/showthread.php?tid=273434)



Warning 202 - zxc1 - 01.08.2011

Код:
public IsAtRussiaTurf(playerid)
{
	if(IsPlayerConnected(playerid))
	{
	    if(PlayerToPoint(1,playerid,2137.051,-256.9133,2896.113,420.4035))
		{
			return 1;
		}
	}
	return 0;
}
The Warning:
Код:
warning 202: number of arguments does not match definition
In this line:
Код:
if(PlayerToPoint(1,playerid,2137.051,-256.9133,2896.113,420.4035))



Re: Warning 202 - Cypress - 01.08.2011

Oops i'm wrong. You have the wrong coordinates. Or maybe you included the angle.

pawn Код:
if(PlayerToPoint(1.0,playerid,2137.051,-256.9133,2896.113))
Try this.


Re: Warning 202 - AndreT - 01.08.2011

Quote:
Originally Posted by Cypress
Посмотреть сообщение
pawn Код:
if(PlayerToPoint(1.0,playerid,2137.051,-256.9133,2896.113,420.4035))
?

He has one parameter too many. I suppose you accidentally included the angle.


Re: Warning 202 - sleepysnowflake - 01.08.2011

Can you show us hte stock of your PlayerToPoint ?


Re: Warning 202 - zxc1 - 01.08.2011

Код:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
    new Float:oldpos[3], Float:temppos[3];
    GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
    temppos[0] = (oldpos[0] -X);
    temppos[1] = (oldpos[1] -Y);
    temppos[2] = (oldpos[2] -Z);
    if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
    {
        return true;
    }
    return false;
}



Re: Warning 202 - Kush - 01.08.2011

Quote:
Originally Posted by Cypress
Посмотреть сообщение
Oops i'm wrong. You have the wrong coordinates. Or maybe you included the angle.

pawn Код:
if(PlayerToPoint(1.0,playerid,2137.051,-256.9133,2896.113))
Try this.
Why not just use IsPlayerInRangeOfPoint...?


Re: Warning 202 - sleepysnowflake - 01.08.2011

Now let me help you dude, find the coordinates you need, IN GAME, and then put ONLY the X, Y and Z and nothing more ... Thoguht I do not see hwo that helps you determinate what kind of turf that is ... But nevermind.


Re: Warning 202 - zxc1 - 01.08.2011

This problem has been fixed thanks to everyone.


Re: Warning 202 - sleepysnowflake - 01.08.2011

Reputation to everyone ?


Re: Warning 202 - zxc1 - 01.08.2011

How? And I have another question.

I have this code:
Код:
command(ruturf, playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
		if(gTeam[playerid] == Allied)
		{
			if(PlayerToPoint(20,playerid,2459.1743,115.5314,26.4794))
			{
                GangZoneFlashForAll(Russia, White);
				SendClientMessage(playerid,Gold,"You have to wait 1 minute untill the turf will be yours");
                SendClientMessageToAllAxis("The Germany Forces are trying to take over your turf. Head over your base immediately and protect it.");
                SendClientMessageToAllAxis("You have 1 minute until they will have full control over your turf.");
				GameTextForPlayer(playerid,"~w~60 Seconds Left",10000,5);
				GameTextForPlayer(playerid,"~w~50 Seconds Left",10000,5);
				GameTextForPlayer(playerid,"~w~40 Seconds Left",10000,5);
				GameTextForPlayer(playerid,"~w~30 Seconds Left",10000,5);
				GameTextForPlayer(playerid,"~w~20 Seconds Left",10000,5);
				GameTextForPlayer(playerid,"~w~10 Seconds Left",10000,5);
				GameTextForPlayer(playerid,"~w~0 Seconds Left",10000,5);
				GangZoneStopFlashForAll(Russia);
				GangZoneShowForAll(Russia,Green);
				SendClientMessage(playerid,Gold,"The turf has been passed to the Germany Forces");
				SendClientMessageToAllAllies("You have successfuly captured the enemy's turf.");
			}
			else
			{
			    SendClientMessage(playerid,Admin,"You are not close enough to the Russian base.");
			}
		}
		else
		{
			SendClientMessage(playerid,Admin,"You can't take your own turf.");
		}
	}
	return 1;
}
How I can make it to really wait 1 minute until the turf color changes?


Re: Warning 202 - sleepysnowflake - 01.08.2011

Timers ?


Re: Warning 202 - zxc1 - 01.08.2011

But how to use the timers? I don't know how to use them...


Re : Warning 202 - Soumi - 01.08.2011

https://sampwiki.blast.hk/wiki/SetTimer


Re: Warning 202 - zxc1 - 01.08.2011

You are not helping by giving some sites of Wiki.
Just say you don't know.
I asked him how to do SetTimer from my command.


Re: Warning 202 - zxc1 - 02.08.2011

bump.
Someone?


Re: Warning 202 - zxc1 - 02.08.2011

Help?