PDA

View Full Version : Help Checkpoints not showing


astanalol
26/01/2015, 04:54 PM
Hello Guys
i Have Problems When i Type 1 or 2 The Checkpoints not showing why ?
my full code
#include <a_samp>
#include <Streamer>
#include <zcmd>
#include <sscanf2>

new house1Ent, house1Exit;
new house2Ent, house2Exit;


CMD:createhouse(playerid, params[])
{
new type,interior;
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(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(pl ayerid),-1,-1,100.0);
}
}

{
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(pl ayerid),-1,-1,100.0);
}
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == house1Ent)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,271.884979,306.631988,999.14 8437);
}
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.14 8437);
}
else if(checkpointid == house2Exit)
{
SetPlayerPos(playerid,1526.229980,-11.574499,1002.097106);
}
return 1;
}

astanalol
26/01/2015, 08:24 PM
Any One ?

nezo2001
26/01/2015, 08:46 PM
What is the type for ?

astanalol
26/01/2015, 09:07 PM
What is the type for ?

nothings i want it enter and exit with out commands :D

astanalol
27/01/2015, 01:59 PM
Bumb!

astanalol
27/01/2015, 06:23 PM
guys where all :(

astanalol
29/01/2015, 12:31 PM
Bumbbbbbbbbb!

astanalol
30/01/2015, 03:15 PM
Bumb Please Help me To Showing The CP Please :)

astanalol
31/01/2015, 08:27 AM
Bumbbbbbbbbb!

ATGOggy
31/01/2015, 08:36 AM
Your code has so much mistakes.

You didn't use 'type' anywhere, what is it?

ATGOggy
31/01/2015, 08:40 AM
Try this:
#include <sscanf2>

new house1Ent, house1Exit;
new house2Ent, house2Exit;


CMD:createhouse(playerid, params[])
{
new type,interior;
new Float:x, Float:y, Float:z;
if(sscanf(params,"ii", interior, type)) return SendClientMessage(playerid, -1, "/createhouse [1~2(interior)][1~2(1=enter, 2=exit)]");
if(interior > 2 || interior<1) SendClientMessage(playerid, -1, "Invaild Interior ID");
GetPlayerPos(playerid, x, y, z);
if(type==1)
{
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(pl ayerid),-1,-1,100.0);
}
}
else if(type==2)
{
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(pl ayerid),-1,-1,100.0);
}
}
return 1;
}
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == house1Ent)
{
SetPlayerInterior(playerid,2);
SetPlayerPos(playerid,271.884979,306.631988,999.14 8437);
}
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.14 8437);
}
else if(checkpointid == house2Exit)
{
SetPlayerPos(playerid,1526.229980,-11.574499,1002.097106);
}
return 1;
}

By the way, you need to change all these global variables to House specific or you'll be able to create only one house in the server.

Also, the correct spelling is 'bump', not 'bumb'. :P