PlayerToPoint and SkinID check
#1

Hi guys i try to make this

pawn Код:
public footballcheck(playerid, skinid)
{
  if(PlayerToPoint(10.0, playerid, 1321.6389,2154.3713,10.8203))
    else if(skinid != 97 && skinid != 154) return SendClientMessage(playerid,0xFF0000FF,"You must be football player!");
  return 1;
}
I wanna to do: If is player To point 1321.6389,2154.3713,10.8203 and if he dont have this skin id`s 97 and 154 to get message "You must be football player!"

i make whit timer and when i press F6 i get this

C:\Users\NASTIE\Desktop\ExtremeFun\filterscripts\C heckpoint.pwn(954) : error 029: invalid expression, assumed zero
C:\Users\NASTIE\Desktop\ExtremeFun\filterscripts\C heckpoint.pwn(954 -- 955) : warning 215: expression has no effect
C:\Users\NASTIE\Desktop\ExtremeFun\filterscripts\C heckpoint.pwn(955) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

bump
Reply
#3

pawn Код:
public footballcheck(playerid, skinid)
{
  if(PlayerToPoint(10.0, playerid, 1321.6389,2154.3713,10.8203))
  {
    if(skinid != 97 || skinid != 154)
    {
      SendClientMessage(playerid,0xFF0000FF,"You must be a football player!");
      return 1;
    }
  }
  else
  {
    SendClientMessage(playerid,0xFF0000FF,"You're not at the football arena !");
    return 1;
  }
}
something like this?
Reply
#4

That is good you help me but when i am in that point whit diffrend skin ID i dont get message....i try something like this

Код:
public nogometprovjera(playerid, skinid)
{
	#define skinid GetPlayerSkin(playerid)
  if(PlayerToPoint(10.0, playerid, 1321.4984,2153.7661,11.0234))
  {
    if(GetPlayerSkin(playerid) != 97 || skinid != 154) return SendClientMessage(playerid,0xFF0000FF,"You must be a football player!");
  }
  return 1;
}
But still dont work...I didnt define "skinid" maybe is that problem?
Reply
#5

Yup, try to define the "skinid".
Reply
#6

new skinid = GetPlayerSkin(playerid);
Reply
#7

When i put
Код:
new skinid = GetPlayerSkin(playerid);
i get this warning

Код:
C:\Users\NASTIE\Desktop\ExtremeFun\filterscripts\Checkpoint.pwn(959) : warning 219: local variable "skinid" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#8

Quote:
Originally Posted by Jay420
pawn Код:
public footballcheck(playerid, skinid)
{
  if(PlayerToPoint(10.0, playerid, 1321.6389,2154.3713,10.8203))
  {
    skinid = GetPlayerSkin(playerid);
    if(skinid != 97 || skinid != 154)
    {
      SendClientMessage(playerid,0xFF0000FF,"You must be a football player!");
      return 1;
    }
  }
  else
  {
    SendClientMessage(playerid,0xFF0000FF,"You're not at the football arena !");
    return 1;
  }
}
Is correct, but to receive the message, there must be a SetTimer with this function ^^ =D
Reply
#9

Use this method, because the IsPlayerInRangeOfPoint ( native ) faster than PlayerToPoint ( pawn ) function

pawn Код:
public footballcheck(playerid, skinid)
{
  if(IsPlayerInRangeOfPoint(playerid, 10.0, 1321.6389, 2154.3713, 10.8203))
  {
    skinid = GetPlayerSkin(playerid);
    if(skinid != 97 || skinid != 154)
    {
      SendClientMessage(playerid, 0xFF0000FF, "You must be a football player!");
    }
  }
  else
  {
    SendClientMessage(playerid, 0xFF0000FF, "You're not at the football arena !");
  }
}
Reply
#10

Omg guys im so imberess all codes are awesome but i make mistake

i forrgot put timer XD OMG im imberess
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)