I have opened the .inc test, which creates checkpoint, rob, enter, and so on.
Who can teach me how it works?
I tried it and it did not work or I did not use it properly.
Who can teach me how it works?
PHP Code:
/********************************
++ California Cops and RObbers ++
++ By Bondowocopz ++
********************************/
#define istest 1 // Uncomment This Line If You Want To Use Some Test Command On Test.inc
#define USE_SOCKET 1 // Uncomment this line if you want to use socket
PHP Code:
COMMAND:testdata(playerid, params[])
{
new data[50], a, b, Float:c, Float:d;
format(data, sizeof(data), "0;20;0.000;1.000");
if(sscanf(data, "p<;>ddff", a, b, c, d))
{
Server(playerid, "gagal");
}
else
{
printf("A = %d\nB = %d\nC = %f\nD = %f", a, b, c, d);
}
return 1;
}
COMMAND:specialaction(playerid, params[])
{
new level;
if(sscanf(params, "d", level))
{
Usage(playerid, "testdrunk <level>");
}
else
SetPlayerSpecialAction(playerid, level);
return 1;
}
COMMAND:testdrunk(playerid, params[])
{
new level;
if(sscanf(params, "d", level))
{
Usage(playerid, "testdrunk <level>");
}
else
SetPlayerDrunkLevel(playerid, level);
return 1;
}
#if defined USE_037
COMMAND:createactor(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateActor(181, x, y, z, 0.0);
return 1;
}
COMMAND:savedata(playerid, params[])
{
saveData(playerid);
ResetPlayerWeapons(playerid);
return 1;
}
COMMAND:loaddata(playerid, params[])
{
loadData(playerid);
return 1;
}
COMMAND:createrob(playerid, params[])
{
new store[56], place[56], prize;
if(sscanf(params, "s[56]s[56]d", store, place, prize))
{
return Usage(playerid, "createrob <store> <place> <max prize>");
}
else
{
new Float:x, Float:y, Float:z, Float:ang, message[512];
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, ang);
CreateDynamicCP(x, y, z, 10.0, -1, GetPlayerInterior(playerid));
format(message, sizeof(message), "{{%f, %f, %f, %f}, \"%s\", \"%s\", %d, %d},", x, y, z, ang, store, place, GetPlayerInterior(playerid), prize);
Log("CPenum.html", message, false);
}
return 1;
}
COMMAND:createenter(playerid, params[])
{
new maptype;
if(sscanf(params, "d", maptype))
{
return Usage(playerid, "createenter <map type>");
}
else
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i < MAX_CP; i++)
{
if(!IsValidDynamicCP(GM[CPs][i]))
{
GM[CPs][i] = CreateDynamicCP(x, y, z, 10.0, -1, -1);
GetPlayerFacingAngle(playerid, angle);
Player[playerid][savedPos][0] = x;
Player[playerid][savedPos][1] = y;
Player[playerid][savedPos][2] = z;
Player[playerid][savedPos][3] = angle;
SetPVarInt(playerid, "cp", i);
SetPVarInt(playerid, "map", maptype);
break;
}
}
}
return 1;
}
COMMAND:createexit(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:angle, message[256];
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
format(message, sizeof(message), "{{%f, %f, %f, %f}, {%f, %f, %f, %f}, %d, %d},", Player[playerid][savedPos][0], Player[playerid][savedPos][1], Player[playerid][savedPos][2], Player[playerid][savedPos][3], x, y, z, angle, GetPlayerInterior(playerid), GetPVarInt(playerid, "map"));
Log("savedPos.html", message, false);
return 1;
}
COMMAND:back(playerid, params[])
{
SetPlayerPos(playerid, Player[playerid][savedPos][0], Player[playerid][savedPos][1], Player[playerid][savedPos][2]);
SetPlayerFacingAngle(playerid, Player[playerid][savedPos][3]);
return 1;
}
COMMAND:createlocker(playerid, params[])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
DestroyDynamicObject(GM[tempObj][0]);
DestroyDynamicObject(GM[tempObj][1]);
DestroyDynamicObject(GM[tempObj][2]);
GM[tempObj][0] = CreateDynamicObject(2003, x, y, z, 0.0000, 0.0000, -90.000);
GM[tempObj][1] = CreateDynamicObject(2004, x, y, z, 0.0000, 0.0000, -90.000);
GM[tempObj][2] = CreateDynamicObject(2005, x, y, z, 0.0000, 0.0000, -90.000);
return 1;
}
COMMAND:write(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, msg[1000];
GetDynamicObjectPos(GM[tempObj][0], x, y, z);
GetDynamicObjectRot(GM[tempObj][0], rx, ry, rz);
format(msg, sizeof(msg), "{{%f, %f, %f, %f, %f, %f}, ", x, y, z, rx, ry, rz);
GetDynamicObjectPos(GM[tempObj][1], x, y, z);
GetDynamicObjectRot(GM[tempObj][1], rx, ry, rz);
format(msg, sizeof(msg), "%s{%f, %f, %f, %f, %f, %f}, ", msg, x, y, z, rx, ry, rz);
GetDynamicObjectPos(GM[tempObj][2], x, y, z);
GetDynamicObjectRot(GM[tempObj][2], rx, ry, rz);
format(msg, sizeof(msg), "%s{%f, %f, %f, %f, %f, %f}}", msg, x, y, z, rx, ry, rz);
Log("saveGan.html", msg, false);
return 1;
}
COMMAND:select1(playerid, params[])
{
EditDynamicObject(playerid, GM[tempObj][0]);
return 1;
}
COMMAND:select2(playerid, params[])
{
EditDynamicObject(playerid, GM[tempObj][1]);
return 1;
}
COMMAND:select3(playerid, params[])
{
EditDynamicObject(playerid, GM[tempObj][2]);
return 1;
}
COMMAND:house(playerid, params[])
{
new houseid;
if(sscanf(params, "d", houseid))
{
Usage(playerid, "house <houseid>");
}
else
{
if(houseid >= MAX_HOUSE_INT)
{
return 0;
}
else
{
SetPlayerPos(playerid, HouseInt[houseid][intPos][0], HouseInt[houseid][intPos][1], HouseInt[houseid][intPos][2]);
SetPlayerFacingAngle(playerid, HouseInt[houseid][intPos][3]);
SetPlayerInterior(playerid, HouseInt[houseid][houseintID]);
}
}
return 1;
}
COMMAND:savepos(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:angle, msg[256];
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
format(msg, sizeof(msg), "{%f, %f, %f}", x, y, z);
Log("savedPoz.html", msg, false);
return 1;
}
COMMAND:mapicon(playerid, params[])
{
if(!adminLevel(playerid, 6))
return 0;
new Float:x, Float:y, Float:z, type;
if(sscanf(params, "d", type))
{
return Usage(playerid, "mapicon <icon type>");
}
else
{
GetPlayerPos(playerid, x, y, z);
DestroyDynamicMapIcon(GM[testIcon]);
GM[testIcon] = CreateDynamicMapIcon(x, y, z, type, 1);
Server(playerid, "Map icon successfully created.");
}
return 1;
}
COMMAND:createcp(playerid, params[])
{
new comment[30], Float:x, Float:z, Float:y, msg[56];
if(sscanf(params, "s[30]", comment))
{
Usage(playerid, "createcp <comment>");
}
else
{
GetPlayerPos(playerid, x, y, z);
format(msg, sizeof(msg), "{%f, %f, %f}, // %s", x, y, z, comment);
Log("cptest.html", msg, false);
}
return 1;
}
COMMAND:saveveh(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new msg[512], Float:x, Float:y, Float:z, Float:a;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
format(msg, sizeof(msg), "{{%f, %f, %f, %f}, %d},", x, y, z, a, GetVehicleModel(vehicleid));
Log("savedVeh.html", msg, true);
}
return 1;
}
COMMAND:addhouse(playerid, params[])
{
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
Player[playerid][savedPos][0] = x;
Player[playerid][savedPos][1] = y;
Player[playerid][savedPos][2] = z;
Player[playerid][savedPos][3] = angle;
return 1;
}
COMMAND:savehouse(playerid, params[])
{
new msg[1000];
new Float:x, Float:y, Float:z, Float:angle;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
format(msg, sizeof(msg), "{{%f, %f, %f, %f}, {%f, %f, %f, %f}, %d}", Player[playerid][savedPos][0], Player[playerid][savedPos][1], Player[playerid][savedPos][2], Player[playerid][savedPos][3], x, y, z, angle, GetPlayerInterior(playerid));
Log("houseEnum.html", msg, true);
return 1;
}
COMMAND:gotofront(playerid, params[])
{
new Float:distance, Float:x, Float:y, Float:z;
if(sscanf(params, "f", distance))
{
Usage(playerid, "gotofront <distance>");
}
else
{
GetXYZInFrontOfPlayer(playerid, x, y, z, distance);
SetPlayerPos(playerid, x, y, z);
}
return 1;
}
COMMAND:testmenu(playerid, params[])
{
new Menu:test;
test = CreateMenu("Test Menu", 3, 15.0, 10.0, 5.0);
AddMenuItem(test, 2, "TEST GAN");
ShowMenuForPlayer(test, playerid);
return 1;
}
COMMAND:gotohouse(playerid, params[])
{
new i;
if(sscanf(params, "d", i))
{
Usage(playerid, "gotohouse <id>");
}
else
{
SetPlayerPos(playerid, House[i][housePos][0], House[i][housePos][1], House[i][housePos][2]);
}
return 1;
}
COMMAND:testsound(playerid, params[])
{
new int;
if(sscanf(params, "d", int))
{
Usage(playerid, "testsound <id>");
}
else
{
PlayerPlaySound(playerid, int, 0.0, 0.0, 0.0);
}
return 1;
}