Help With This
#1

now i need ahelp from you guys i made this its work fine and all i need that i cant define 2 IDS in OnPlayerEnterCheckpoint When i use giveplayerid and use it under its only give me ID 0 in not anything else just (0) help me with this guys

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new string[256];
    if(getCheckpointType(playerid) == 18 && getCheckpointType(playerid) == 18)
   {
	if(PlayerDragged[playerid] == 1)
	{
	new swatname[24];
              new wantedsuspect[24];
	new giveplayerid;
	GetPlayerName(giveplayerid,swatname,24);
              GetPlayerName(playerid,wantedsuspect,24);
	SendClientMessage(playerid, 0xA9A9A9AA, "|_Los Santos Police Department_|");
	format(string, sizeof(string), "You have given %s(%d) to LSPD and he is been detained by Police",wantedsuspect,playerid);
	SendClientMessage(giveplayerid,0x00C7FFAA,string);
	format(string, sizeof(string), "Swat-Member %s(%d) Has Handed You in LSPD and you been detained by PD Police",swatname,giveplayerid);
	SendClientMessage(playerid,0x00C7FFAA,string);
	new rnd;
	rnd = random(sizeof (ArrestedSpawn));
	SetPlayerPos(playerid, ArrestedSpawn[rnd][0], ArrestedSpawn[rnd][1], ArrestedSpawn[rnd][2]);
	SetPlayerFacingAngle(playerid, ArrestedSpawn[rnd][3]);
	SetPlayerInterior(playerid,6);
	format(string, sizeof(string), "Wanted suspect %s(%d) has handed by Swat-Member %s(%d) into LSPD and has been detained by police",wantedsuspect,playerid,swatname,giveplayerid);
	SendClientMessageToAll(0x00C7FFAA, string);

	SendClientMessage(playerid,0x00C7FFAA,"You will be auto-released from jail or a Police Officer/Jail Turnkey can release you early");
	format(string, sizeof(string), "Wanted suspect %s(%d) has handed by Swat-Member %s(%d) into LSPD and has been detained by police",wantedsuspect,playerid,swatname,giveplayerid);
    printf("%s", string);

    Jailed[playerid] =1;
	StoleCopCarRecent[playerid] =0;
	cannotescapejail[playerid] =0;
	ResetPlayerWeapons(playerid);
	PlayerDragged[playerid] =0;
	JailTime[playerid] =60;
	JailTimeServed[playerid] =0;
	SetPlayerWantedLevel(playerid,0);
	oscore = GetPlayerScore(giveplayerid);
	SetPlayerScore(playerid, giveplayerid +1);
	arrestsrank[giveplayerid] +=1;
	return 1;
    }
Reply
#2

Your creating the variable ( new giveplayerid; ), but are never putting any data in it. New variables always default to 0!

You need to, put something in giveplayerid!
Reply
#3

can you play fix that code i gived up and tell me how please
Reply
#4

Quote:
Originally Posted by funky1234
Посмотреть сообщение
Your creating the variable ( new giveplayerid; ), but are never putting any data in it. New variables always default to 0!

You need to, put something in giveplayerid!
Indeed, and you can use sscanf for that one.
Reply
#5

Quote:
Originally Posted by [MKD]Max
Посмотреть сообщение
can you play fix that code i gived up and tell me how please
What is "giveplayerid" supposed to be? I don't see any hint of what it should be...
Reply
#6

sscanf at OnPlayerEnterCheckpoint How This
Reply
#7

Quote:
Originally Posted by funky1234
Посмотреть сообщение
What is "giveplayerid" supposed to be? I don't see any hint of what it should be...
Quote:
Originally Posted by [MKD]Max
Посмотреть сообщение
sscanf at OnPlayerEnterCheckpoint How This
I can't assist you any further if I don't know two things:
  • What/who "giveplayerid" should be
  • What is supposed to be split with sscanf
Again, I can't assist you any further if you don't answer those.
Reply
#8

giveplayerid should be the swat when swat enter checkout and the suspect with him put the swat name and suspect name the suspect name i already done but the swat its cant done its stay all time give me ID (0) help!
Reply
#9

So the "SWAT" player, must be in the checkpoint with the other player?

So they're BOTH entering the checkpoint?
Reply
#10

yea when both enter checkpoint send client message say like this


Swat-Member %s(%d) Has Handed %s(%d) Into Lspd <-- now i need in text to give me swatname and the swat id not give me ID 0 only for Ex. swat member player ID 6 the suspect is already on with playerid now all i need to make giveplayerid work on swat

Swat-Member Killer(6) Has Handed Max(1) Into Lspd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)