08.12.2010, 02:50
pawn Код:
if(strcmp(cmd, "/object", true) == 0 || strcmp(cmd, "/obj", true) == 0)
{
if (IsPlayerInVehicle(playerid,vehicleid) && PlayerInfo[playerid][pAdmin] == 1 && ObjectId[playerid] == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[[CMDINFO]] /object [objectid] [rx] [ry] [rz]");
return 1;
}
new id = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[[CMDINFO]] /object [objectid] [rx] [ry] [rz]");
return 1;
}
new rx = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[[CMDINFO]] /object [objectid] [rx] [ry] [rz]");
return 1;
}
new ry = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[[CMDINFO]] /object [objectid] [rx] [ry] [rz]");
return 1;
}
new rz = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_SYSTEM, "[[CMDINFO]] /object [objectid] [rx] [ry] [rz]");
return 1;
}
new Float:x,Float:y,Float:z;
GetVehiclePos(vehicleid, x, y, z);
//Fire[playerid] = CreateDynamicObject(id, x, y, z, 0, 0, 0);
Fire[playerid] = CreateObject(id,x,y,z,rx,ry,rz);
ObjectId[playerid] = 1;
format(string, sizeof(string), "Object created with id %d and Coords X:%f | Y:%f | Z:%f | RX:%d | RY:%d | RZ:%d", id,x,y,z,rx,ry,rz);
SendClientMessage(playerid, COLOR_GREEN, string);
AttachObjectToVehicle(Fire[playerid],vehicleid,rx,ry,rx,0,0,0);
return 1;
}
}