SA-MP Forums Archive
Help With This - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help With This (/showthread.php?tid=281507)



Help With This - [MKD]Max - 06.09.2011

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;
    }



Re: Help With This - Ash. - 06.09.2011

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!


Re: Help With This - [MKD]Max - 06.09.2011

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


Re: Help With This - =WoR=G4M3Ov3r - 06.09.2011

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.


Re: Help With This - Ash. - 06.09.2011

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...


Re: Help With This - [MKD]Max - 06.09.2011

sscanf at OnPlayerEnterCheckpoint How This


Re: Help With This - Ash. - 06.09.2011

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: Again, I can't assist you any further if you don't answer those.


Re: Help With This - [MKD]Max - 06.09.2011

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!


Re: Help With This - Ash. - 06.09.2011

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

So they're BOTH entering the checkpoint?


Re: Help With This - [MKD]Max - 06.09.2011

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