public IsAtRussiaTurf(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerToPoint(1,playerid,2137.051,-256.9133,2896.113,420.4035))
{
return 1;
}
}
return 0;
}
warning 202: number of arguments does not match definition
if(PlayerToPoint(1,playerid,2137.051,-256.9133,2896.113,420.4035))
if(PlayerToPoint(1.0,playerid,2137.051,-256.9133,2896.113))
|
pawn Код:
|
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;
}
|
Oops i'm wrong. You have the wrong coordinates. Or maybe you included the angle.
pawn Код:
|
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;
}