SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 31/03/2010, 09:20 PM   #1
DarkPower
Gangsta
 
DarkPower's Avatar
 
Join Date: Feb 2010
Posts: 645
Reputation: 7
Default PlayerToPoint and SkinID check

Hi guys i try to make this

pawn Code:
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 (c) 1997-2006, ITB CompuPhase


2 Errors.
DarkPower is offline  
Old 01/04/2010, 06:56 AM   #2
DarkPower
Gangsta
 
DarkPower's Avatar
 
Join Date: Feb 2010
Posts: 645
Reputation: 7
Default Re: PlayerToPoint and SkinID check

bump
DarkPower is offline  
Old 01/04/2010, 07:54 AM   #3
Jay420
Big Clucker
 
Join Date: Jan 2010
Posts: 95
Reputation: 0
Default Re: PlayerToPoint and SkinID check

pawn Code:
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?
Jay420 is offline  
Old 01/04/2010, 08:08 AM   #4
DarkPower
Gangsta
 
DarkPower's Avatar
 
Join Date: Feb 2010
Posts: 645
Reputation: 7
Default Re: PlayerToPoint and SkinID check

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

Code:
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?
DarkPower is offline  
Old 01/04/2010, 08:11 AM   #5
Jay420
Big Clucker
 
Join Date: Jan 2010
Posts: 95
Reputation: 0
Default Re: PlayerToPoint and SkinID check

Yup, try to define the "skinid".
Jay420 is offline  
Old 01/04/2010, 08:18 AM   #6
FlatMaN
Banned
 
Join Date: Jun 2009
Posts: 45
Reputation: 0
Default Re: PlayerToPoint and SkinID check

new skinid = GetPlayerSkin(playerid);
FlatMaN is offline  
Old 01/04/2010, 08:20 AM   #7
DarkPower
Gangsta
 
DarkPower's Avatar
 
Join Date: Feb 2010
Posts: 645
Reputation: 7
Default Re: PlayerToPoint and SkinID check

When i put
Code:
new skinid = GetPlayerSkin(playerid);
i get this warning

Code:
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 (c) 1997-2006, ITB CompuPhase


1 Warning.
DarkPower is offline  
Old 01/04/2010, 08:27 AM   #8
Last_Stand_Guardian
Big Clucker
 
Join Date: Mar 2010
Posts: 126
Reputation: 0
Default Re: PlayerToPoint and SkinID check

Quote:
Originally Posted by Jay420
pawn Code:
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
Last_Stand_Guardian is offline  
Old 01/04/2010, 08:28 AM   #9
-Davee-
Big Clucker
 
Join Date: Dec 2007
Posts: 129
Reputation: 0
Default Re: PlayerToPoint and SkinID check

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

pawn Code:
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 !");
  }
}
__________________
-Davee- is offline  
Old 01/04/2010, 08:35 AM   #10
DarkPower
Gangsta
 
DarkPower's Avatar
 
Join Date: Feb 2010
Posts: 645
Reputation: 7
Default Re: PlayerToPoint and SkinID check

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

i forrgot put timer XD OMG im imberess
DarkPower is offline  
 

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
Need /Skin [SkinID] Command Wasim_Cortez Help Archive 4 22/03/2010 07:22 AM
Playertopoint help Pinehole Help Archive 1 30/10/2009 10:43 PM
SetNpcSkin(skinid) maiccz Help Archive 3 22/10/2009 06:13 AM
Setting player to team from skinid Gould Help Archive 2 04/08/2009 01:58 PM
Help...if playertopoint Jokerr_mayne Help Archive 3 17/04/2009 02:44 PM


All times are GMT. The time now is 06:25 PM.


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