#1

I made a script when a player spawns it sends him a message-
Код:
return SendClientMessage(playerid, 0xFF0000AA, "Head to the checkpoint and get in one of the boats.");
But i want it to send this message only when player is registered means first spawn

necessary details :P

Код:
enum pInfo
{
	pKey[128],
	pLevel,
	pAdmin,
	pPremiumAccount,
	gPupgrade,
	pConnectTime,
	pAFKtime,
	pReg,
	pRegistredDate[24],
	pLastLogin[64],
	pNewbTimer,
	pSex,
	pAge,
	pOrigin[128],
	pBankPin,
	pBankCard,
	pCK,
    pSpeedo,
	pAlarm,
	pAlarmm,
	pRented,
    pParked,
    pHelmet,
	pGlasses,
	pMuted,
	pMuteTime,
	pExp,
	pCash,
	pAccount,
	pCard,
	pCrimes,
	pKills,
	pDeaths,
	pArrested,
	pWantedDeaths,
	pPhoneBook,
	pLottoNr,
	pFishes,
	pBiggestFish,
	pJob,
	pPayCheck,
	pHeadValue,
	pJailed,
	pJailTime,
	pMats,
	pDrugs,
	pLeader,
	pTow,
	pMember,
	pFMember,
	pPunish,
	pFwarn,
	pRank,
	pChar,
	pContractTime,
	pDetSkill,
	pSexSkill,
	pBoxSkill,
	pLawSkill,
	pMechSkill,
	pJackSkill,
	pCarSkill,
	pNewsSkill,
	pDrugsSkill,
	pCookSkill,
	pFishSkill,
	Float:pHealth,
	Float:pSHealth,
	pInt,
	pLocal,
	pTeam,
	pModel,
	pPnumber,
	pPhousekey,
	pCar,
	pMoto,
	pRob,
	pRobSkill,
	pGangKey,
	pPbiskey,
	Float:pPos_x,
	Float:pPos_y,
	Float:pPos_z,
	pCarWarns,
	pCarLic,
	pFlyLic,
	pBoatLic,
	pFishLic,
	pGunLic,
	pPassport,
	pMatsLic,
	pCarLicS,
	pFlyLicS,
	pBoatLicS,
	pFishLicS,
	pGunLicS,
	pMatsLicS,
	pGun1,
	pGun2,
	pGun3,
	pGun4,
	pAmmo1,
	pAmmo2,
	pAmmo3,
	pAmmo4,
	pCarTime,
	pPayDay,
	pPayDayHad,
	pWatch,
	pCrashed,
	pWins,
	pLoses,
	pAlcoholPerk,
	pDrugPerk,
	pMiserPerk,
	pPainPerk,
	pTraderPerk,
	pTut,
	pMissionNr,
	pWarns,
	pVirWorld,
	pFuel, pCanistra,
	pMarried,
	pMarriedTo[128],
	pFishTool,
	pNote1[128],
	pNote1s,
	pNote2[128],
	pNote2s,
	pNote3[128],
	pNote3s,
	pNote4[128],
	pNote4s,
	pNote5[128],
	pNote5s,
	pInvWeapon,
	pInvAmmo,
	pLighter,
	pCigarettes,
	pRequestingBackup,
	pRoadblock,
	pMask,
	pMaskuse,
	pHideNumber,
	pSpeaker,
	pLocked,
	pExamen,
};
Код:
	SetPlayerToTeamColor(playerid);
			SetPlayerPos(playerid,134.6612,-2100.9927,14.0293);
			SetPlayerFacingAngle(playerid, 267.6635);
			SetPlayerInterior(playerid,0);
			PlayerInfo[playerid][pInt] = 0;
		    return SendClientMessage(playerid, 0xFF0000AA, "Head to the checkpoint and get in one of the boats.");
Reply
#2

You need to create a variable for first spawn like

pawn Код:
enum pInfo
{
    pKey[128],
    pLevel,
    pAdmin,
    pPremiumAccount,
    gPupgrade,
    pConnectTime,
    pAFKtime,
    pReg,
    pRegistredDate[24],
    pLastLogin[64],
    pNewbTimer,
    pSex,
    pAge,
    pOrigin[128],
    pBankPin,
    pBankCard,
    pCK,
    pSpeedo,
    pAlarm,
    pAlarmm,
    pRented,
    pParked,
    pHelmet,
    pGlasses,
    pMuted,
    pMuteTime,
    pExp,
    pCash,
    pAccount,
    pCard,
    pCrimes,
    pKills,
    pDeaths,
    pArrested,
    pWantedDeaths,
    pPhoneBook,
    pLottoNr,
    pFishes,
    pBiggestFish,
    pJob,
    pPayCheck,
    pHeadValue,
    pJailed,
    pJailTime,
    pMats,
    pDrugs,
    pLeader,
    pTow,
    pMember,
    pFMember,
    pPunish,
    pFwarn,
    pRank,
    pChar,
    pContractTime,
    pDetSkill,
    pSexSkill,
    pBoxSkill,
    pLawSkill,
    pMechSkill,
    pJackSkill,
    pCarSkill,
    pNewsSkill,
    pDrugsSkill,
    pCookSkill,
    pFishSkill,
    Float:pHealth,
    Float:pSHealth,
    pInt,
    pLocal,
    pTeam,
    pModel,
    pPnumber,
    pPhousekey,
    pCar,
    pMoto,
    pRob,
    pRobSkill,
    pGangKey,
    pPbiskey,
    Float:pPos_x,
    Float:pPos_y,
    Float:pPos_z,
    pCarWarns,
    pCarLic,
    pFlyLic,
    pBoatLic,
    pFishLic,
    pGunLic,
    pPassport,
    pMatsLic,
    pCarLicS,
    pFlyLicS,
    pBoatLicS,
    pFishLicS,
    pGunLicS,
    pMatsLicS,
    pGun1,
    pGun2,
    pGun3,
    pGun4,
    pAmmo1,
    pAmmo2,
    pAmmo3,
    pAmmo4,
    pCarTime,
    pPayDay,
    pPayDayHad,
    pWatch,
    pCrashed,
    pWins,
    pLoses,
    pAlcoholPerk,
    pDrugPerk,
    pMiserPerk,
    pPainPerk,
    pTraderPerk,
    pTut,
    pMissionNr,
    pWarns,
    pVirWorld,
    pFuel, pCanistra,
    pMarried,
    pMarriedTo[128],
    pFishTool,
    pNote1[128],
    pNote1s,
    pNote2[128],
    pNote2s,
    pNote3[128],
    pNote3s,
    pNote4[128],
    pNote4s,
    pNote5[128],
    pNote5s,
    pInvWeapon,
    pInvAmmo,
    pLighter,
    pCigarettes,
    pRequestingBackup,
    pRoadblock,
    pMask,
        pFSpawn,//This One
    pMaskuse,
    pHideNumber,
    pSpeaker,
    pLocked,
    pExamen,
};
then you must do like

pawn Код:
public OnPlayerSpawn(playerid)
{
      if(PlayerInfo[playerid][pFSpawn] == 0)
      {
               SendClientMessage(playerid, 0xFF0000AA, "Head to the checkpoint and get in one of the boats.");
               PlayerInfo[playerid][pFSpawn] = 1;
      }
      return 1;
}
after this

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
      if(PlayerInfo[playerid][pFSpawn] == 1)
      {              
               PlayerInfo[playerid][pFSpawn] = 0;
      }
      return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)