Somone Help Me :D [+RepSsSs] -
astanalol - 21.01.2015
Hello Guys
i Want Know About Exit House DynamicCP
i Want Make the exit in my system
can somone help me +rep please help
PHP код:
#include <a_samp>
#include <Streamer>
#include <zcmd>
#include <sscanf2>
new house1;
new house2;
CMD:createhouse(playerid, params[])
{
new interior;
if(sscanf(params,"i", interior)) return SendClientMessage(playerid, -1, "/createhouse [1~2]");
if(interior == 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
house1 = CreateDynamicCP( x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
}
else if(interior == 2)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
house2 = CreateDynamicCP(x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
}
else
{
SendClientMessage(playerid, -1, "Invaild Interior ID");
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid){
if(checkpointid == house1)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,271.884979,306.631988,999.148437);
}
else if(checkpointid == house2)
{
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,1527.229980,-11.574499,1002.097106 );
}
return 1;}
CP Exit in house1 =
PHP код:
272.884979,306.631988,999.148437
CP Exit in house2 =
PHP код:
1526.229980,-11.574499,1002.097106
help +repss
Re: Somone Help Me :D [+RepSsSs] -
1fret - 21.01.2015
Do you mean you want to make a dynamic checkpoint at those position
- don't really understand what you want
AW: Somone Help Me :D [+RepSsSs] -
Saize - 21.01.2015
You could create a checkpoint and if the play is entering this cp his coordinations will get set to the entrance
If you could tell me how you would like it then I could make it for you
Respuesta: Somone Help Me :D [+RepSsSs] -
Cerealguy - 21.01.2015
pawn Код:
#include <a_samp>
#include <Streamer>
#include <zcmd>
#include <sscanf2>
new house1Ent, house1Exit;
new house2Ent, house1Exit;
CMD:createhouse(playerid, params[])
{
new interior, type;
new Float:x, Float:y, Float:z;
if(sscanf(params,"is", interior, type)) return SendClientMessage(playerid, -1, "/createhouse [1~2][type]");
if(interior > 2) SendClientMessage(playerid, -1, "Invaild Interior ID");
GetPlayerPos(playerid, x, y, z);
if(!strcmp(type, "enter", true))
{
if(interior == 1)
{
house1Ent = CreateDynamicCP( x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
}
else if(interior == 2)
{
house2Ent = CreateDynamicCP(x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
}
}
if(!strcmp(type, "exit", true))
{
if(interior == 1)
{
house1Exit = CreateDynamicCP( x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
}
else if(interior == 2)
{
house2Exit = CreateDynamicCP(x,y,z,2.0,GetPlayerVirtualWorld(playerid),-1,-1,100.0);
}
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == house1Ent)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,271.884979,306.631988,999.148437);
}
else if(checkpointid == house2Ent)
{
SetPlayerInterior(playerid,3);
SetPlayerPos(playerid,1527.229980,-11.574499,1002.097106 );
}
else if(checkpointid == house1Exit)
{
SetPlayerPos(playerid,272.884979,306.631988,999.148437);
}
else if(checkpointid == house2Exit)
{
SetPlayerPos(playerid,1526.229980,-11.574499,1002.097106);
}
return 1;
}