07.08.2011, 10:16
(
Last edited by Mr.1337; 07/08/2011 at 12:21 PM.
)
Hello, there, Today, I am going to show you how to make enter command, with pickup.
So, Lets get started.
At the top of your script, write this:Code:
#include <a_samp>
Code:
IsPlayerInRangeOfPoint(playerid,Float:range, Float:x, Float:y, Float:z);
You need also:
Code:
SetPlayerPos(playerid,Float:x,Float:y,Float:z);
Code:
SetPlayerInterior(playerid, InteriorID);
Code:
SetPlayerVirtualWorld(playerid, VirtualWorldID);
And at the end, you have to:
Code:
return 1;
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/enter",cmdtext, true, 10) == 0) { if(IsPlayerInRangeOfPoint(playerid,3.0,681.5620,-474.2185,16.5363)) SetPlayerPos(playerid, 678.2614,-464.6447,-25.6172); SetPlayerInterior(playerid, 1); SetPlayerVirtualWorld(playerid, 1); return 1; }
At the top of your script:
Code:
new pickupname;
Code:
public OnGameModeInit() {
Code:
pickupname = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld)
You can get the type here
You can get the cords (X,Y,Z) by typing /save, blabla.
Example:
Code:
new Mr1337;
Code:
Public OnGameModeInit() { Mr1337 = CreatePickup(1318, 23, 2165.9231,-1671.2072,15.0732,-1); return 1; }
Hope i helped.