Warning 202
#1

Код:
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))
Reply
#2

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.
Reply
#3

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.
Reply
#4

Can you show us hte stock of your PlayerToPoint ?
Reply
#5

Код:
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;
}
Reply
#6

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...?
Reply
#7

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.
Reply
#8

This problem has been fixed thanks to everyone.
Reply
#9

Reputation to everyone ?
Reply
#10

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?
Reply
#11

Timers ?
Reply
#12

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

https://sampwiki.blast.hk/wiki/SetTimer
Reply
#14

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.
Reply
#15

bump.
Someone?
Reply
#16

Help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)