Help How to create entrance for only vip
#1

Hello In My Server I want to create entrance and exit without command For Vip Room when player range the point, Player Set Positions and only vip can enter to the vip room if anyone can please create and give me the coods please
Reply
#2

Create a pickup / cp, assign its Id to a variable and on onplayerpickuppickup / onplayerentercheckpoint check if the entered pickup / cp is VIP entrance, if so check if player is VIP, if yes set his pos to where ever you want otherwise no reactions
Reply
#3

I Create but I Got A Warning When I Compile My Gamemode,

This is My Gamemode,


#include <a_samp>

#if defined FILTERSCRIPT

#else

main()
{
print("\n----------------------------------");
print(" Test");
print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

new caselev=CreateObject(2659, 2044.7013, 1348.3530, 12.6420, 0.0000, 0.0000, 0.0000);
SetObjectMaterialText(caselev, "{66FFFF}American {FF3366} Airlines",0, OBJECT_MATERIAL_SIZE_256x128,"Times New Roman", 75, 1, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
SetPlayerPos(1970.81934, 1343.73401, 14.54726);
DisablePlayerCheckpoint(playerid);
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}

public OnRconCommand(cmd[])
{
return 1;
}

public OnPlayerRequestSpawn(playerid)
{
return 1;
}

public OnObjectMoved(objectid)
{
return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
AddStaticPickup(19607, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}

public OnPlayerExitedMenu(playerid)
{
return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}

public OnPlayerUpdate(playerid)
{
return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}


And This Is Warning,

C:\Users\nawas\Downloads\samp037_svr_R2-1-1_win32\gamemodes\Untitled.pwn(97) : warning 213: tag mismatch
C:\Users\nawas\Downloads\samp037_svr_R2-1-1_win32\gamemodes\Untitled.pwn(97) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#4

Add a Pickup or a CP at Enter and Exit points. in OnPlayerPickupPickup or OnPlayerEnterCheckpoint, put a condition,
PHP код:
 if(PlayerInfo[playerid][pVIP] >= 1)
{
     
SetPlayerPos(playeridX,Y,Z);
}
else

   
SendClientMessage(playerid, -1"You are not VIP.");

Above Code is an Example that you can use. replace all variables with your own according to your script.

EDIT: after seeing your code i think its wrong. Put CP or Pickup under OnGameModeInit(), then on OnPlayerPickupPickup or OnPlayerEnterCheckpoint, using a Variable check if player is in VIP entrance or at some other place, like
PHP код:
if(pickupid == VIP_Enter// for Pickup
{
     if(
PlayerInfo[playerid][pVIP] >= 1)
{
     
SetPlayerPos(playeridX,Y,Z);
}
else

   
SendClientMessage(playerid, -1"You are not VIP.");
}

Reply
#5

Yes, Thanks For The Help
Reply
#6

This is obviously something you're trying to do, but this is surely in the wrong place.

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
AddStaticPickup(19607, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;
}
Also from your code, you have a OnPlayerEnterCheckpoint, and a OnPlayerPickupPickup, yet nowhere in the script did you actually make those checkpoints/pickups.

And what pickup you create, is created when someone picks up a pickup, so thus, it'll never turn up.
Reply
#7

Quote:
Originally Posted by GTLS
Посмотреть сообщение
Add a Pickup or a CP at Enter and Exit points. in OnPlayerPickupPickup or OnPlayerEnterCheckpoint, put a condition,
PHP код:
 if(PlayerInfo[playerid][pVIP] >= 1)
{
     
SetPlayerPos(playeridX,Y,Z);
}
else

   
SendClientMessage(playerid, -1"You are not VIP.");

Above Code is an Example that you can use. replace all variables with your own according to your script.

EDIT: after seeing your code i think its wrong. Put CP or Pickup under OnGameModeInit(), then on OnPlayerPickupPickup or OnPlayerEnterCheckpoint, using a Variable check if player is in VIP entrance or at some other place, like
PHP код:
if(pickupid == VIP_Enter// for Pickup
{
     if(
PlayerInfo[playerid][pVIP] >= 1)
{
     
SetPlayerPos(playeridX,Y,Z);
}
else

   
SendClientMessage(playerid, -1"You are not VIP.");
}

Quote:
Originally Posted by iLearner
Посмотреть сообщение
Create a pickup / cp, assign its Id to a variable and on onplayerpickuppickup / onplayerentercheckpoint check if the entered pickup / cp is VIP entrance, if so check if player is VIP, if yes set his pos to where ever you want otherwise no reactions
Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
This is obviously something you're trying to do, but this is surely in the wrong place.

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
AddStaticPickup(19607, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;
}
Also from your code, you have a OnPlayerEnterCheckpoint, and a OnPlayerPickupPickup, yet nowhere in the script did you actually make those checkpoints/pickups.

And what pickup you create, is created when someone picks up a pickup, so thus, it'll never turn up.
Yes, I Know I Delete This One,

AddStaticPickup(19607, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;

And I Put New One What GTLS Told Me,

Thanks
Reply
#8

Quote:
Originally Posted by Ayyash
Посмотреть сообщение
Yes, I Know I Delete This One,

AddStaticPickup(19607, 2, 1506.3359, 1432.3585, 10.1191, 0);
return 1;

And I Put New One What GTLS Told Me,

Thanks
Yes, but WHERE?

Chances are it still won't work if you've simply copied and pasted what GTLS posted.


The ONLY way it will actually work is if you've done "VIP_ENTER = AddStaticPickup(all,the,parameters,in,here);"
Reply
#9

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Yes, but WHERE?

Chances are it still won't work if you've simply copied and pasted what GTLS posted.


The ONLY way it will actually work is if you've done "VIP_ENTER = AddStaticPickup(all,the,parameters,in,here);"
Yup, my code was just an example in which you have to make changes. also check out OnPlayerPickupPickup or OnPlayerEnterCheckpoint and Create Checkpoint or Create Pickup. on SA-MP Wiki for syntax and other example help.

EDIT:
here are the links:
SetPlayerCheckpoint
For Adding Pickup
OnPlayerEnterCheckpoint
OnPlayerPickupPickup
Reply
#10

I was asking them where they'd put the code in, as it pertains to our future "This code doesn't work" thread...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)