31.10.2016, 12:44
These commands doesn't work in my server.
PHP код:
CMD:barrel(playerid) //Doesn't create an object
{
if(barrel[playerid] == 1)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(1225,x,y,z, 0.00, 0.00, 0.00);
SendClientMessage(playerid, COLOR_GRAD1, "You have planted a barrel. Shoot at it to make it explode.");
}
else
{
SendClientMessage(playerid, 0x33CCFFAA,"You must buy a barrel from the shop!");
}
return 1;
}
CMD:rope(playerid,params[]) //Doesn't create the rope.
{
if(rready[playerid] == 0) return SendClientMessage(playerid, 0x33CCFFAA,"You must buy a rope from the shop!");
new Float:X1, Float:Y1, Float:Z1,Float:Angle;
SetPlayerHealth(playerid, 2000);
rappel[playerid] = 1;
rready[playerid] = 0;
GetPlayerPos(playerid, X1, Y1, Z1);
GetPlayerFacingAngle(playerid, Angle);
SetPlayerPos(playerid, X1, Y1, Z1+5);
new i=1;while(IsValidObject(i))i++;
rope[i] = CreateObject(19089, X1, Y1, Z1+5, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1+3, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1+1, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-2, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-5, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-7, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-9, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-10, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-12, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-17, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-25, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-28, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-31, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-34, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-38, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-41, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-45, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-49, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-51, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-57, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-61, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-65, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-69, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-73, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-77, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-80, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-85, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-89, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-90, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-95, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-87, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-100, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-105, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-110, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-115, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-120, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-125, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-130, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-135, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-140, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-145, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-150, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-155, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-160, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-165, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-170, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-175, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-180, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-185, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-190, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-195, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-200, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-205, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-210, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-215, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-220, 0, 0, Angle);
rope[i] = CreateObject(19089, X1, Y1, Z1-225, 0, 0, Angle);
ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
return 1;
CMD:laseron(playerid,params[]) //Works fine
{
if(haslaser[playerid] == 1)
{
SetPVarInt(playerid, "laser", 1);
SetPVarInt(playerid, "color", GetPVarInt(playerid, "color"));
SetPlayerAttachedObject( playerid,9, 18643, 6, 0.158249, 0.010233, 0.128052, 6.868255, 351.962524, 356.884216 );
SendClientMessage(playerid, COLOR_GRAD1, "You have equipped a laser from your inventory. /laseroff to unequip it. /lasercol to change it's color");
}
else
{
SendClientMessage(playerid, -1, "*"COL_RED"You don't have a laser in your inventory. Buy one from the shop!");
}
return 1;
}
CMD:lasercol(playerid, params[]) //Doesn't change the color
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /lasercol [color] (Red, Blue, Pink, Orange, Green, Yellow)");
if(!strcmp(params, "red", true)) SetPVarInt(playerid, "color", 19080);
else if(!strcmp(params, "blue", true)) SetPVarInt(playerid, "color", 18643),SetPlayerAttachedObject( playerid,9, 18643, 6, 0.158249, 0.010233, 0.128052, 6.868255, 351.962524, 356.884216 );
else if(!strcmp(params, "pink", true)) SetPVarInt(playerid, "color", 19081),SetPlayerAttachedObject( playerid,9, 19081, 6, 0.158249, 0.010233, 0.128052, 6.868255, 351.962524, 356.884216 );
else if(!strcmp(params, "orange", true)) SetPVarInt(playerid, "color", 19082),SetPlayerAttachedObject( playerid,9, 19082, 6, 0.158249, 0.010233, 0.128052, 6.868255, 351.962524, 356.884216 );
else if(!strcmp(params, "green", true)) SetPVarInt(playerid, "color", 19083),SetPlayerAttachedObject( playerid,9, 19083, 6, 0.158249, 0.010233, 0.128052, 6.868255, 351.962524, 356.884216 );
else if(!strcmp(params, "yellow", true)) SetPlayerAttachedObject( playerid,9, 19084, 6, 0.158249, 0.010233, 0.128052, 6.868255, 351.962524, 356.884216 );
else SendClientMessage(playerid, COLOR_GREY, "Color not available!");
return 1;
}
}