/parole problem
#1

Hello i have one problem with my parole cmd

i am using sscanf

Код:
C:\Gta Sa Server Vernieuwd\gamemodes\freeroam.pwn(1968) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
this is the /parole cmd

Код:
 	dcmd_parole(playerid, params[])
	{
	new
		id;
	if (sscanf(params, "u", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/parole <playerid>\"");
	else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
	else if (GetDistanceBetweenPlayers(playerid,id) > 3) SendClientMessage(playerid,donkerrood,"The player is too far away");
	else if (gTeam[playerid] != TEAM_COPS) { SendClientMessage(playerid,donkerrood,"You aren't a Cop"); }
	else if (gTeam[id] == TEAM_COPS) { SendClientMessage(playerid,donkerrood,"You cant Parole a cop"); }
	else if (!GetPlayerPos(id,264.3700,77.5700,1001.0391)) {
	SendClientMessage(playerid,donkerrood,"Player isn't in jail"); }
	else if (gTeam[playerid] == TEAM_COPS) {
	{
		SetPlayerPos(id,1553.1476,-1675.2872,16.1953);
		SetPlayerInterior(playerid,0);
		SendClientMessage(id, 0x00FF00AA, "You have paroled by a cop");
		SendClientMessage(playerid, 0x00FF00AA, "Player paroled"); }
	}
	return 1;
	}
Reply
#2

And line 1968 is... ?
Reply
#3

Код:
if(!GetPlayerPos(id,264.37,77.57,1001.03))
What's this?
And give the error line
Reply
#4

Use ProxdetectorS instead.


pawn Код:
//At the top:
forward ProxDetectorS(Float:radi, playerid, targetid);

//Anywehre else
public ProxDetectorS(Float:radi, playerid, targetid)
{
  if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        //radi = 2.0; //Trigger Radius
        GetPlayerPos(targetid, posx, posy, posz);
        tempposx = (oldposx -posx);
        tempposy = (oldposy -posy);
        tempposz = (oldposz -posz);
        //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
        if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
        {
            return 1;
        }
    }
    return 0;
}
So then instead of using GetPlayerPos, do like this:

pawn Код:
if(!ProxDetectorS(5.0, playerid,id)) // change the 5.0 for how many meters around that should be available
Reply
#5

but i am using getplayerpos for jail

look

is someone is already jailed

so

the position of jailpositen

(GetPlayerPos(id,Jailposition)) { SendClientMessage(playerid,donkerrood,"Player is already jailed!!"); }
Reply
#6

Use PlayerToPoint.
Reply
#7

Any tuts

i don't know ANYTHING about it

so is there a one tut i could understand(im using sscanf)
Reply
#8

Use this instead of GetPlayerPos:
pawn Код:
else if (!PlayerToPoint(5, id,264.3700,77.5700,1001.0391)) return SendClientMessage(playerid,donkerrood,"Player is not in jail");
Somewhere outside your callbacks:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)