Sziasztok
Van egy /dropgun parancsom de amikor eldobom a fegyvert nem hozza létre a szerver az objectet.
Kód:
CMD:dropgun(playerid, params[])
{
new
world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new GunID = GetPlayerWeapon(playerid);
new GunAmmo = GetPlayerAmmo(playerid);
if(GunID > 0 && GunAmmo != 0)
{
new f = MAX_OBJ+1;
for(new a = 0; a < MAX_OBJ; a++)
{
if(dGunData[a][ObjPos][0] == 0.0)
{
f = a;
break;
}
}
if(f > MAX_OBJ) return SendClientMessage(playerid, COLOR_LIGHTRED, \"Megtelt az eldobható objectek száma ezért most nem tudod eldobni a fegyvered.\");
RemovePlayerWeapon(playerid, GunID);
dGunData[f][ObjData][0] = GunID;
dGunData[f][ObjData][1] = GunAmmo;
dGunData[f][ObjInt] = interior;
dGunData[f][ObjWorld] = world;
GetPlayerPos(playerid, dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]);
dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-1, 93.7, 120.0, 120.0, world, interior, -1, 200.0, 0.0);
new buffer[50];
format(buffer, sizeof(buffer), \"Eldobtad a(z) %s típusú fegyvered.\", GunNames[dGunData[f][ObjData][0]]);
SendClientMessage(playerid, -1, buffer);
// Logging bans
new dropgunstring[256];
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
format(dropgunstring, sizeof(dropgunstring), \"[%d:%d:%d] %s eldobott egy %s típusú fegyvert.\", Hour, Minute, Second, GetName(playerid), GunNames[dGunData[f][ObjData][0]]);
DropGunLog(dropgunstring);
// -------------------------------------------------------
}
return 1;
}
Amikor eldobom a fegyvert ezt írja:ű
[16:20:13] [sampgdk:warning] Native function not found: GetPlayerInterior
[16:20:13] [sampgdk:warning] Native function not found: GetPlayerVirtualWorld
[16:20:13] [sampgdk:warning] Native function not found: GetPlayerState
[16:20:13] [sampgdk:warning] Native function not found: CreatePickup
[/quote]