Need help with OnPlayerExitVehicle
#1

Hello i can you tel me why this work.

Код:
if(strcmp(cmd,"/seatbelt",true)==0)
  {
  if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  {
	SendClientMessage(playerid,COLOR_GREY,"You are not in any vehicle");
  	return 1;
	}
  if(PlayerInfo[playerid][pSeatBelt] == 1)
  {
  	PlayerInfo[playerid][pSeatBelt] = 0;

	return 1;
	}
And this dont work
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerInfo[playerid][pSeatBelt] == 1)
  {
  	PlayerInfo[playerid][pSeatBelt] = 0;
 
  	return 1;
	}
______________________________________
Full script
Код:
if(strcmp(cmd,"/seatbelt",true)==0)
  {
  if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  {
	SendClientMessage(playerid,COLOR_GREY,"You are not in any vehicle");
  	return 1;
	}
  if(PlayerInfo[playerid][pSeatBelt] == 1)
  {
  	PlayerInfo[playerid][pSeatBelt] = 0;
  GetPlayerName(playerid, sendername, sizeof(sendername));
  new stringtosee[255];
  new ftext[255];
  if(PlayerInfo[playerid][pSex] == 1) { ftext = "his"; }
  else if(PlayerInfo[playerid][pSex] == 1) { ftext = "her"; }
  format(stringtosee, sizeof(stringtosee), "* %s unbuckles %s seat belt", sendername , ftext);
  ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
  	return 1;
	}
	PlayerInfo[playerid][pSeatBelt] = 1;
  GetPlayerName(playerid, sendername, sizeof(sendername));
  new stringtosee[255];
  new ftext[255];
  if(PlayerInfo[playerid][pSex] == 1) { ftext = "his"; }
  else if(PlayerInfo[playerid][pSex] == 1) { ftext = "her"; }
  format(stringtosee, sizeof(stringtosee), "* %s buckles %s seat belt", sendername , ftext);
  ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
	return 1;
	}
And this is one who dont work
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(PlayerInfo[playerid][pSeatBelt] == 1)
  {
  	PlayerInfo[playerid][pSeatBelt] = 0;
  new stringtosee[255];
  new sendername[MAX_PLAYER_NAME];
  GetPlayerName(playerid, sendername, sizeof(sendername));
  new ftext[255];
  if(PlayerInfo[playerid][pSex] == 1) { ftext = "his"; }
  else if(PlayerInfo[playerid][pSex] == 1) { ftext = "her"; }
  format(stringtosee, sizeof(stringtosee), "* %s unbuckles %s seat belt", sendername , ftext);
  ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA);
  	return 1;
	}
return 1;
}
Reply


Messages In This Thread
Need help with OnPlayerExitVehicle - by vovz - 17.04.2009, 13:15
Re: Need help with OnPlayerExitVehicle - by linxx - 17.04.2009, 15:18

Forum Jump:


Users browsing this thread: 1 Guest(s)