Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Procedure to create an object at a specific players database position
- requires two parameters
- otype and fuel
- set fuel to 0 if it is a building
- example:
- exec createobj 'TentStorage', 0
- Change UID and Instance before creating
- */
- CREATE DEFINER=`dayz`@`localhost` PROCEDURE `createobj`(IN `otype` VARCHAR(50), IN `fuel` DOUBLE)
- LANGUAGE SQL
- NOT DETERMINISTIC
- CONTAINS SQL
- SQL SECURITY DEFINER
- COMMENT ''
- BEGIN
- set @NewID = (select (max(id)+1) as id1 from dayz.objects) ;
- set @uid1 = (select (max(uid)+1) as id1 from dayz.objects) ;
- set @pos1 = (select pos from dayz.main where death = 0 and uid = '32850310');
- update dayz.objects
- set instance = 1
- where Id = @NewID;
- insert into dayz.objects
- set Id = @NewID;
- update dayz.objects
- set uid = @uid1
- where Id = @NewID;
- update dayz.objects
- set pos = @pos1
- where Id = @NewID;
- update dayz.objects
- set Inventory = '[]'
- where Id = @NewID;
- update dayz.objects
- set otype = otype
- where Id = @NewID;
- update dayz.objects
- set fuel = fuel
- where Id = @NewID;
- END
Add Comment
Please, Sign In to add comment